0

I have two types of products in my site Type 1 :products with Customizable Options Type 2 :products without Customizable Options

I wish to add one custom class(for css purpose) to the products which has Customizable Options, i mean I need a css class for Type 1 products. Please provide me a solution

  • Use $isHasOptions = $product->getTypeInstance()->hasOptions($product); to determine whether product has options or not – Tuyen Nguyen Nov 23 '18 at 7:11
  • Okay, where the responding template of the customizable options are load in PDP page – Jaisa Nov 23 '18 at 7:17
1

If Customizable_option is product attribute option than get value of this attribute and store in variable.

if($Customizable_option){ $class =  'Customizable_class';} <br>
if($without_Customizable_option)
{ 
  $class =  'without_Customizable_class';
  }
<br>

$class variable put in HTML element class

0

In backend,while adding customizable options for the product then the magento adds the div class for the PDP page in frontend. The div class is product-options-wrapper .

So no need for customization

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.