[SOLVED] Not defined variants returns free product
#1 Color: Blue, Red
#2 Size: Small, Big
And you have a Product in tree variants:
#1 Product: Blue, Small
#2 Product: Blue, Big
#3 Product: Red, Big
There is something that i think is a problem:
#4 Product: Red, Small is going to be selectable on product page tough it does not actually exists.
I can live with the fact that the variant can be selectable but there's something that i don't understand:
- The price of that selection (Product: Red, Small in this case) is set to "Free" as default thus creating confusion in the user.
This can be edited in the language file with changing the "free" field with "The variant you selected is not available" and with some explanation on the product description you can overcome (partially) this situation but this modification means that you're not going to be able to have free products anymore
Despite the fact that the product fortunately gets "Out of stock" message thus making it unavailable to order, the right way to handle this, IMHO, is to have an error message when the user select an unavailable variant, this can replace the "free" price tag.
It could be better to show/hide options based on the selection but this is something that i don't really understand how can be implemented.
So, my question is, how can i override that "free" price with something more coherent when a situation like this occurs without touching language files and loosing the possibility to give products for free?
Thanks in advance.
Please Log in or Create an account to join the conversation.
You could edit the view "product / listing_price" and add a check on the variable: "$this->row->product_published".
For example:
Please Log in or Create an account to join the conversation.
Could you please help me understanding where exactly in the view "product/listing_price" file should i add the line of code you suggest.
That file is pretty complex.
I don't want to mess everything up.
Thanks in advance
Please Log in or Create an account to join the conversation.
By:
Please Log in or Create an account to join the conversation.
Thanks a lot.
Please Log in or Create an account to join the conversation.
First let me make a little mistake in the code you gave me, there was a semicolon missing at the end of ('NOT_ON_SALE')
so the right one should be:
This way the modification makes me open the website, without that semicolon everything crashes.
****
I have made the mod but i still get free price instead of non available....
What am i doing wrong?
Thanks in advance. If you need i can give you access to backoffice/front end
Please Log in or Create an account to join the conversation.
My apologize, for the variants you have to edit the view "product / quantity" and replace the line:
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I've just got a subscription to the business version, i will update and then we continue talking about this in some minutes, i can send you a PM with access to the front end so you can see what i'm experiencing.
See you later.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Thanks.
Please Log in or Create an account to join the conversation.
I tried the solution given again, and for me when a variant is not enabled, the message "Not available" is displayed instead of "No stock".
Could you give us a front & back end access ?
Please Log in or Create an account to join the conversation.
This is my csv
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
Ok I see from where come the problem.
I was thinking that the variants not available were unpublished, and not "not present" in your shop.
If you only unpublish the variant the modification given should work fine.
Tomorrow I will find another solution to your problem.
Please Log in or Create an account to join the conversation.
because i have created two characteristic for the whole international category, one for the volume in Lt. of the package and another one for the color palette of that brand, if i simply create all possible variants and then deactivate those ones i don't need my csv's are going to be ten times bigger and mainly full of unavailable variants, and that add a lot of unnecessary data on the database.
I'm following for your answer, I'm preparing a product import for around 5K products and i need to define the characteristics the most efficient and generalist possibly so i can use them in more than one product category and this situation of the non available characteristics is going to happen very frequently.
Have a good day and thanks again for your support.
Please Log in or Create an account to join the conversation.
Hope this time it's the good solution
Try to replace the code:
In the view "product / quantity".
Please Log in or Create an account to join the conversation.
The code is not exactly as you write it, it should be:
It actually shows the string in the product quantity part of the product page but it only works if the cart functionality is activated (it does not work if you're in catalog mode) this is not cool because we're still strugglin' with legal paperwork for activate the cart options so we need to open right now only with the button for "ask info" and showing prices.
Is possible to make something similar but with the product>listing_price view?
So i can have the PRODUCT_NOT_AVAILABLE message instead of the FREE_PRICE i have now when i select an non existing variant?
This issue is delaying me to continue the content population and i have a really big quantity of products.
I don't want to find myself creating all my product listing again, i have done this at least 3 times in the last year and when you have 5K products is a real pain so any advice is welcome.
Thanks
Please Log in or Create an account to join the conversation.
In catalog mode, the view "product / quantity" is loaded.
Try to add the code:
If it doesn't work thanks to give me a screenshot of your configuration, by this way I will be able to reproduce the problem on my end.
Please Log in or Create an account to join the conversation.
Whatever, i'll be making this mods in the afternoon, i'll be back to you then.
Please Log in or Create an account to join the conversation.