How to show quantity on product listing?

  • Posts: 9
  • Thank you received: 0
13 years 2 months ago #24521

On the product listing page, not the product page, I am listing product in 4 columns with the 'image and title', price and the 'add to cart' button.

This is good, but there is no quantity field to accompany the Add to Cart button. This means it only adds a quantity of 1 to the cart and I really need to have the ability for customers to enter a quantity.

How can I show the Quantity on this page for each product, and position it to the left of the Add to cart button, just as it is on the product page?

Please Log in or Create an account to join the conversation.

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
13 years 2 months ago #24537

You can edit the file listing_img_title of the view product via the menu Display->Views and add the code:
$this->params->set('show_quantity_field', 1);
at the beginning after the first <?php tag.

The following user(s) said Thank You: Mat, d2dpcs

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
13 years 2 months ago #24566

Thanks Nicholas. That works perfectly.

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
13 years 1 month ago #25842

Does this still work for version : 1.5.3?

I don't even see the field 'show_quantity_field' called in the php file (listing_img_title.php)

Regards,

Gosling


COBIZ webdevelopment | www.cobiz.nl

Please Log in or Create an account to join the conversation.

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
13 years 1 month ago #25848

That's normal that you don't see it because you need to ADD it :)
It still works with 1.5.3. That question was asked 3 weeks after the 1.5.3 was released.

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
13 years 1 month ago #25851

I pasted the code in that file but it did not work for me. No quantity field was shown in my listings page.

So I was wondering where the field was called in the same file, but ofcourse the param could very well be read by every other file, your right about that! :_)


COBIZ webdevelopment | www.cobiz.nl

Please Log in or Create an account to join the conversation.

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
13 years 1 month ago #25864

And did you activate the display of the add to cart button on the products listing with the corresponding option ? Because if there is no add to cart button, there won't be any quantity field displayed.

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
13 years 1 month ago #26233

Thanks, it worked! (ofcourse :-)


COBIZ webdevelopment | www.cobiz.nl

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
13 years 1 month ago #26254

Would be great to have this param available in the 'HikaShop Options' for modules/menus. Because I only need it in some views, not in all.


COBIZ webdevelopment | www.cobiz.nl

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
12 years 11 months ago #29766

Hi

I am new to Hikashop (after giving up on Virtuemart) and am after the same this as in this thread. I have added the code and activated the Add to Cart feature. I can see the "add to cart" button but I can't see the product quantity next to the product.

Do I need to activate something else?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
12 years 11 months ago #29769

Hi,

Did you set the HikaShop Options on your menu-item like this?
Then it should work.

And ofcourse you should have added the code like the admin showed in the above message.

Good luck,

Gosling


COBIZ webdevelopment | www.cobiz.nl
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
12 years 11 months ago #29771

Hi, thanks for coming back so quickly.

I added the PHP code as explained. My config is now exactly the same apart from when I change the Sub Element filter to "Direct Sub Elements" the products disappear. Could it be that I have the products set up incorrectly?

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
12 years 11 months ago #29775

OK. No I have it set up exactly like yours and it still isn't playing.

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
12 years 11 months ago #29776

Hi,

I'm just another user that got crazy with Virtuemart. And I am going to setup a new website with Hikashop in the near future and that's why I was playing with Hikashop.

The messages from the admin helped me to get the listing as you cam see in my attachment. (No Design changes done at all here, it's just a test :-)

But as you can see, it works for me.

Did it a while ago so I can't figure out which steps I did except for those mentioned above by the admin.

Btw, the admin respons quick well in this forum!


Succes,

Gosling


COBIZ webdevelopment | www.cobiz.nl
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
12 years 11 months ago #29777

ok ok I am an idiot. I was applying it to the wrong template.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
12 years 11 months ago #29778

BTW. When you have set product Characteristics, you can't see the quantity-field in listing-mode.


COBIZ webdevelopment | www.cobiz.nl

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
12 years 11 months ago #29779

Thanks for your help. Virtuemart was far too complex to understand. I just never found it intuitive.

So far I think I am as far as you. Any idea how to change the look / CSS so the quantity and the add to cart button aren't so close together, also I would like to move them to the right of the image and not underneath them.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 38
  • Thank you received: 0
12 years 11 months ago #29780

I build some sites with Virtuemart, but now I'm changing to Hikashop.

For changes to the layout, you'll need to have (some) knowledge of html and css, and maybe even php & javascript for more complex adjustments.
This knowledge I can't teach you on the fly. You'll have to study it yourself a bit :-)

Goodluck,

Gosling


COBIZ webdevelopment | www.cobiz.nl

Please Log in or Create an account to join the conversation.

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
12 years 11 months ago #29795

To put more spacing, you can try to add some CSS code in the front end CSS file that you can edit via the Display tab of the configuration:
.hikashop_product_stock table td{ padding-right: 10px; }

Please Log in or Create an account to join the conversation.

  • Posts: 182
  • Thank you received: 15
12 years 7 months ago #41967

It didn't work for me to add to the file listing_img_title.php as you suggested, I poked around little among the files and found that if I added the line $this->params->set('show_quantity_field', 1); to the file quantity.php at line 48 it worked and I now have the box as I want.



Jan

The following user(s) said Thank You: dselby

Please Log in or Create an account to join the conversation.

Time to create page: 0.126 seconds
Powered by Kunena Forum