The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.
 
 
Thread Tools Display Modes
  #1  
Old 01-02-2013, 01:31 AM
Taylor Amarel's Avatar
Taylor Amarel is offline
Junior Member
 
Join Date: Jan 2013
Posts: 3
Default

Query String to Automatically Fill Out Product Options


Hello, I'll keep it quick;

I have a site with multiple products. A few of these products have product options. For simplicity sake lets say I'm selling shoes. So my store consists of numerous types and shoes and each shoe has product options. Lets say the options represent size.

I would like to have a link/URL that a customer or link can click on and it would automatically fill out the product option text box.

Currently I tried using query strings and pass the variable to a value of the product option text box. This appears to be on the right track however the box only contains the proper text while the page is loading, after loading completely the box is empty.

Any help would be greatly appreciated.
  #2  
Old 01-03-2013, 12:17 PM
Matt Ecwid's Avatar
Matt Ecwid Matt Ecwid is offline
Ecwid Team
 
Join Date: Oct 2011
Posts: 4,947
Default

Quote:
Originally Posted by Taylor Amarel View Post
Hello, I'll keep it quick;

I have a site with multiple products. A few of these products have product options. For simplicity sake lets say I'm selling shoes. So my store consists of numerous types and shoes and each shoe has product options. Lets say the options represent size.

I would like to have a link/URL that a customer or link can click on and it would automatically fill out the product option text box.

Currently I tried using query strings and pass the variable to a value of the product option text box. This appears to be on the right track however the box only contains the proper text while the page is loading, after loading completely the box is empty.

Any help would be greatly appreciated.
Hello,

Ecwid is an AJAX application, it means that products, categories and all the other content of your store is delivered to a visitor dynamically using JavaScript. Your storefront integrates in your site and acts like a part of it, thus, by means of custom JavaScript mods, you can modify Ecwid behavior and look in many different ways.

So, as you suggested, you can change the default text fields values with the help of a custom script placed on your store page: you can handle the page loading using the Ecwid Javascript API and then modify the page content using jQuery. More details on Ecwid Javascript API:
http://kb.ecwid.com/w/page/41188517/JavaScript%20API

In your case, you will need to use the Ecwid.OnPageLoaded event - it will allow you making the changes after the page is completely loaded.
__________________
Matt K
Ecwid Team

Ecwid Guide for Beginners

Ecwid Help Center

Ecwid video tutorials
  #3  
Old 01-18-2013, 09:33 PM
Taylor Amarel's Avatar
Taylor Amarel Taylor Amarel is offline
Junior Member
 
Join Date: Jan 2013
Posts: 3
Default

Hi Matvey,

Thank you, your answer worked and helped me find a solution.

Regards,
  #4  
Old 01-28-2013, 12:53 AM
Taylor Amarel's Avatar
Taylor Amarel Taylor Amarel is offline
Junior Member
 
Join Date: Jan 2013
Posts: 3
Default

Hi Matvey,

It seams as though I am having this problem again. I think it is because of a javascript or coding error because it did work, however now it doesn't. Here is a snippet of code;

Code:
<script src="//app.ecwid.com/script.js?" type="text/javascript" charset="UTF-8"></script>
<script>
Ecwid.OnPageLoaded.add(function(page) {
document.getElementById('ecwid-productoption-10453515-Callsign').value= "<?= $callsign ?>";
});
</script>
I did some troubleshooting that leads me to believe there is a coding error by simply placing an alert('test'); both inside Ecwid.OnPageLoaded.add and outside which did not execute.

The site is http://www.abraxasenergy.com/store/?purchase=hlt-HFD.

Thank you.
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:29 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.