large amount of variants causes large html files

  • Posts: 152
  • Thank you received: 0
13 years 2 weeks ago #29901

Hi,

I'm currently working on a shop that sells bespoke furniture. The furniture products have the option of 120 fabrics and 8 different legs. This means there are a total of 120 x 8 = 960 variants.

Each of these variants adds a section to the html on the parent product page, for example:

<div id="hikashop_product_name_143_15" style="display:none;">PRDUCT NAME: <span class="hikashop_product_variant_subname"> CHARACTERISITICS</span></div>
<div id="hikashop_product_code_143_15" style="display:none;">PRODUCT_CODE</div>
<div id="hikashop_product_price_143_15" style="display:none;"><span class="hikashop_product_price_full"><span class="hikashop_product_price">£415.00</span>  each</span></div>
<div id="hikashop_product_quantity_143_15" style="display:none;"></div>
<div id="hikashop_product_contact_143_15" style="display:none;"></div>
<div id="hikashop_product_weight_143_15" style="display:none;">Weight: 0.2 kg<br /></div>
<span id="hikashop_product_url_143_15" style="display:none;"></span>
<span id="hikashop_product_id_143_15"><input type="hidden" name="product_id" value="1515" /></span>
<div id="hikashop_product_image_144_15" style="display:none;">
<div id="hikashop_main_image_div_144_15" >
<div class="hikashop_product_main_image_thumb" id="hikashop_main_image_thumb_div_144_15" ><a title="classic-small-chaise-longue2" rel="{handler: 'image'}" target="_blank" href="/media/com_hikashop/upload/classic-small-chaise-longue2.jpg" onclick="SqueezeBox.fromElement(this,{parse: 'rel'});return false;" id="hikashop_main_image_144_15_link"><img src="/media/com_hikashop/upload/thumbnail_156x250/classic-small-chaise-longue2.jpg" alt="classic-small-chaise-longue2" id="hikashop_main_image_144_15" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle" height="156" width="250"  /></a></div></div>
</div>

with 960 variants, the html page is 1.5mb in size. There is a lot of repetition in the html since the weight and images are the same for each variant. Also, the contact button and manufacturer url are not in use. Is there any way to streamline what data is added to the html file for each variant? The only information that changes per product for our setup is the price, name, code and ID.

For an example of this please see bit.ly/vvEDfA

Thanks,

Phil


Create your own style of luxury bespoke furniture online
Last edit: 13 years 2 weeks ago by plantpotphil.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 2 weeks ago #29913

Yes. You can edit the file "show" of the view "product" via the menu Display->Views and remove all the variants blocks you don't need.

For example, if the description does not change, you can remove the code:
<div id="hikashop_product_description_<?php echo $variant_name;?>" style="display:none;">
<?php echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$variant->product_description));?>
</div>

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

  • Posts: 152
  • Thank you received: 0
13 years 2 weeks ago #29922

I knew there'd be a simple solution :)

I've reduced the html size by around 65% now.

I <3 Hikashop


Create your own style of luxury bespoke furniture online

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

Time to create page: 0.056 seconds
Powered by Kunena Forum