0

Could someone guide me how i can Remove product options wrapper if attribute set to yes

Screenshot
https://prnt.sc/uiebh1

I have successfully remove the add to cart button but when i trying to use same code into wrapper.phtml page showing error.

Code i m using

<?php if($_product->getData('remove_addtocart')==1): ?>
YES
<?php else: ?>
NO
<?php endif; ?>

1 Answer 1

0

You will need to change your code slightly as you are in a different block. you can achieve this by doing the following

<?php if($block->getProduct()->getData('remove_addtocart') === 1): ?>
 // If value is 1 then show
<?php endif; ?>
1
  • Thanks Working fine
    – user51556
    Sep 18, 2020 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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