- Posts: 145
- Thank you received: 6
Display the quantity field for non-existent products
2 years 9 months ago - 2 years 9 months ago #357302
by levelup
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Display the quantity field for non-existent products was created by levelup
-- HikaShop version -- : 5.0.0
Hi
Why is the quantity field displayed in the product list view for non-existent products? Product stock is 0. Therefore, the quantity field should not be displayed:
This happens when the user is logged in. Not displayed for guest user:
Hi
Why is the quantity field displayed in the product list view for non-existent products? Product stock is 0. Therefore, the quantity field should not be displayed:
This happens when the user is logged in. Not displayed for guest user:
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Last edit: 2 years 9 months ago by levelup.
Please Log in or Create an account to join the conversation.
2 years 9 months ago #357304
by nicolas
Replied by nicolas on topic Display the quantity field for non-existent products
Hi,
I don't read arabic but I suppose that the yellow button on your screenshot is the "add to wishlist" button. Since you can add several items of the same product in the wishlist, the quantity input field needs to be displayed if the add to wishlist button is displayed.
A product can be added to the wishlist even without any stock.
I don't read arabic but I suppose that the yellow button on your screenshot is the "add to wishlist" button. Since you can add several items of the same product in the wishlist, the quantity input field needs to be displayed if the add to wishlist button is displayed.
A product can be added to the wishlist even without any stock.
The following user(s) said Thank You: levelup
Please Log in or Create an account to join the conversation.
2 years 9 months ago #357343
by levelup
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Replied by levelup on topic Display the quantity field for non-existent products
Of course, it should be possible to add a product to the wishlist even without any stock. But i think there is no need to display the quantity field.
Life is the unique stage of our art. Everyone sings their own song and leaves the stage. The stage is always permanent. Blessed is that song that people remember.
Please Log in or Create an account to join the conversation.
2 years 9 months ago #357344
by nicolas
Replied by nicolas on topic Display the quantity field for non-existent products
Hi,
Well, if you don't want users to be able to add more than 1 item of a product to their wishlist when the product doesn't have any stock left, you would need to do some view overrides via the menu Display>Views.
For the products listing, you can edit the view file add_to_cart_ajax.php
There, add the line:
after the line:
And you can add the same code after the line:
in the file quantity.php which is used for the product details page.
Well, if you don't want users to be able to add more than 1 item of a product to their wishlist when the product doesn't have any stock left, you would need to do some view overrides via the menu Display>Views.
For the products listing, you can edit the view file add_to_cart_ajax.php
There, add the line:
Code:
if(!$add_to_cart) { $this->quantityLayout = 'show_simple'; }
Code:
if($display_quantity_field && (!$global_on_listing || !$has_required_fields )) {
Code:
if(($add_to_cart || $add_to_wishlist) && $display_quantity_field) {
The following user(s) said Thank You: levelup
Please Log in or Create an account to join the conversation.
Time to create page: 0.228 seconds