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
Prev Previous Post   Next Post Next
  #11  
Old 02-18-2015, 11:32 AM
enot's Avatar
enot enot is offline
 
Join Date: Oct 2014
Posts: 499
Default

Quote:
Originally Posted by Th sp View Post
Hi Stephan,

Thank you very much!
I appreciate the help.

I did try your code. It does change the Qty to 5, but unfortunately it does so for ALL products.
Have not been able to fix it yet.

Any ideas?

Thanks!
Hi!

Sorry, I've indeed missed a couple of parts while editing, that's why the second condition was ignored, and the script changed quantity for all product pages.

To make this work, id's should be wrapped in brackets, and "productId" should be replaced with "page.productID".

Here's the code that should do the trick (This and my previous messages were edited, to prevent anyone else from getting the wrong script).

Code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>
if (typeof(Ecwid) == 'object') {
Ecwid.OnPageLoaded.add(function(page) {
var pids = [3432333, 3432332, 4543212];
if ('PRODUCT' == page.type)
for(var i=0; i<pids.length; i++) {
if (pids[i]==page.productId)
{
$('input.ecwid-productBrowser-details-qtyTextField').val('5');
}
}
});
}
</script>

Hope this helps.

Last edited by enot; 02-18-2015 at 07:31 PM. Reason: Corrected the code, left a note
 
The information in this thread might be outdated
If the solution did not help, please, check our Help Portal or contact Ecwid Team.

Tags
box, product, quantity

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 08:32 AM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.