Jump to content

[Solved] Quantity Box in List View Added, but with issues, PLEASE HELP ME FIX TWO ISSUES.


Recommended Posts

I need help, a simple mod to the product list view to add a quantity button now is slowing my site and requires refresh to function. Site is www.DieselSurplusStore.com

I followed instructions from this topic: http://www.prestashop.com/forums/viewthread/28136/P0/general_discussion/solved_add_quantity_box_to_product_listing

In themes folder find file "product-list.tpl" and replace this code below around line 51 (in 1.4.17)

{if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}
{l s='Add to cart'}
{else}



with this code

{if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}
{l s='Quantity :'}
   <input type="text" name="ajax_qty_to_add_to_cart[{$product.id_product|intval}]" id="quantity_wanted_{$product.id_product|intval}" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" />
{l s='Add to cart'}
{else}



Then in the modules>blockcart folder find the file: ajax-cart.js
and change the code below you will find around line 37 (in version 1.4.17)

ajaxCart.add(idProduct, null, false, this);



to replace it with this code:

ajaxCart.add(idProduct, null, false, this, $('#quantity_wanted_'+idProduct).val());



I got it to work with two exceptions which is my issues here:

1. The animation to add it to the cart when you enter a quantity and then hit add to cart does not work and it will not actually put it into the cart until you refresh your screen.

2. Also the site is now VERY SLOW when it was extremely fast before this mod.

I need help.. Any suggestions to these two problems??

Link to comment
Share on other sites

  • 2 weeks later...

This forum is going to the birds.. weeks now and no help on this issue..
What is happening here.. I used to post and have an answer within hours.. Now weeks not a single word! HELLO>> HELP PLEASE..

I need help, a simple mod to the product list view to add a quantity button now is slowing my site and requires refresh to function. Site is www.DieselSurplusStore.com

I followed instructions from this topic: http://www.prestashop.com/forums/viewthread/28136/P0/general_discussion/solved_add_quantity_box_to_product_listing

In themes folder find file "product-list.tpl" and replace this code below around line 51 (in 1.4.17)

{if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}
{l s='Add to cart'}
{else}



with this code

{if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}
{l s='Quantity :'}
   <input type="text" name="ajax_qty_to_add_to_cart[{$product.id_product|intval}]" id="quantity_wanted_{$product.id_product|intval}" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" />
{l s='Add to cart'}
{else}



Then in the modules>blockcart folder find the file: ajax-cart.js
and change the code below you will find around line 37 (in version 1.4.17)

ajaxCart.add(idProduct, null, false, this);



to replace it with this code:

ajaxCart.add(idProduct, null, false, this, $('#quantity_wanted_'+idProduct).val());



I got it to work with two exceptions which is my issues here:

1. The animation to add it to the cart when you enter a quantity and then hit add to cart does not work and it will not actually put it into the cart until you refresh your screen.

2. Also the site is now VERY SLOW when it was extremely fast before this mod.

I need help.. Any suggestions to these two problems??

Link to comment
Share on other sites

  • 3 weeks later...

Hello Tina,

sorry anyone hadn't answered, it was not so easy. I have to add no member of the PrestaTeam were able to help you for that because we are based in France, so we couldn't see anything because of the "restricted by loc" thing.

On your custom theme, there was no picture and the problem was this : when adding to the cart, there is a picture animation which crashes if no pic is present.

See the modified file ajax-cart.js attached to this post to see the modification I made : "If no picture found, just update cart directly"

Regards,

ajax-cart.js

Link to comment
Share on other sites

Michael,

I was home sick or I would have replied as to just how wonderful you are before now. Thank you so very much! Diamonds you are!

Thank you kindly. It works perfectly and so does the other site toolsupplycenter now..

If I could just figure out what is going on with my Javascript on www.turbosupplycenter.com I would be most grateful.. same pass there for you and account already set up! Just in case you get a moment to take a look.

I will email you details.

Thanks again! Your a prince!

Regards, Tina

Link to comment
Share on other sites

One other thing.. for anyone else trying to do this.. once you replace the file.. one needs to go back and make one more change to make it work..

in the module blockcart, file ajax-cart.js

ajaxCart.add(idProduct, null, false, this);

Replace with

ajaxCart.add(idProduct, null, false, this, $('#quantity_wanted_'+idProduct).val());

It is working now..

Here is the proper ajax-cart.js file attached with this change done..ajax-cart.js

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...