Site crash when product has many variants

  • Posts: 57
  • Thank you received: 1
9 years 3 months ago #243409

-- HikaShop version -- : HikaShop Business 2.6.3
-- Joomla version -- : 3.5.1
-- PHP version -- : 7.07
-- Browser(s) name and version -- : Firefox 46

Hey,

I have a product that has 1280 variants. The reason of this amount of variants is the possibilities (Size has 6 options, Paper Weight has 4 options, Printed Sides has 2 options etc...)

The product page either takes forever to load or results in a 500 error or out of memory error. This is on a VPS with 2GB memory allocated.

I understand that variants are heavy because each has options like image, price and so on.

Is there a different way to show all the product options without using Variants? A 'lighter' way to show options?

Link to page

Thanks

Last edit: 9 years 3 months ago by tariaki.

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 2 months ago #243426

Hi,

There are several ways to have dropdowns on the product page besides characteristics:

- options: they can add a cost to the price of the product, like here:
demo.hikashop.com/index.php/en/hikashop/...ct-page/with-options
- custom fields of the table item:
demo.hikashop.com/index.php/en/hikashop/product-page/with-form
They are even better than options for performances as they don't require to load anything from the database. The down side is that they can't change the price/image/etc of the product.
- I see that you have a quantity dropdown. Why would you need that ? There is already a quantity selection system in HikaShop. By default it's an input, but you can convert it into a dropdown with the "quantity input" setting of your product. And since you can configure prices for different minimum quantities, the quantity selected will be able to influence the price of the product in the cart based on the prices configured in the product.

So you should be able to greatly reduce the resources needed there.
Just removing the quantity characteristic of your product would divide by 16 the number of variants on the page. And with less than a hundred variants, the loading of the page should be quite fast.

Last edit: 9 years 2 months ago by nicolas.

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

  • Posts: 2143
  • Thank you received: 747
9 years 2 months ago #243441

Typo:

nicolas wrote: - custom fields: (...) The down side is that they can change the price/image/etc of the product.


Should be:

- custom fields: (...) The down side is that they can not change the price/image/etc of the product.


;)


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 9 years 2 months ago by lousyfool.
The following user(s) said Thank You: nicolas

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

  • Posts: 57
  • Thank you received: 1
9 years 2 months ago #243717

Hey Nicolas,

Thanks for your detailed reply. Very helpful.

To clarify - attached is an example of a product with the available quantitie and the price matrix.

So for example - see line 4 A6, 2pp, 4 col - the prices is fixed to £30 for up to 100 units. Then the prices changes by calculation - for 150 units the price per unit will be £0.20.

As you can see the quantities are not in one increment (100, 200, 300 etc...)

So the question is - if I use the built in Quantity field how do I set up the above?
If it's not possible, I was thinking that adding Quantity as a charectiristic will allow me to set the quamtities with more freedom and using mass action to add the prices. In that case what would be the syntax in the mass action? See attached image - I have created the filters and then to change the price_value I did Update the Values -> Price_Value = Operation -> product.price_value=products.quantity*0.2

It's not working - but is there a way to make this calculation using built in qauntity or using mass action?

Hope it's clear ;)

Attachments:

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 2 months ago #243730

Hi,

As I hinted at in my previous message, you can set the "quantity input" setting to "show select price" and it will base itself on the prices to generate the quantity dropdown. So it doesn't have to be in one increment. Just set the unit price and the corresponding quantity in the Prices area for each choice of the dropdown you want and it will display the quantity selection like that.

For the mass action the operation would be just product.product_quantity*0.2
But I really recommend you to use the quantity selector of HikaShop with different prices. It will be much more lightweight than with characteristics/variants, and much easier to manage for you.

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

  • Posts: 57
  • Thank you received: 1
9 years 2 months ago #244076

Hey

OK maybe I am missing something here...

Please see attached images. I have created different prices based on minimum quantity and chose 'Show Select' in Display to show a drop down. But on frontend I can see a drop down of 1-15.

Ideas?

Thanks

Attachments:

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 2 months ago #244077

Hi,

What you're missing is that you selected the option "show select" and not "show select price" in the "quantity input" field of the product. Only if you select "show select price" will the quantity system base itself on the prices of the product.

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

Time to create page: 0.088 seconds
Powered by Kunena Forum