Author Topic: Display Product Options SKU on Product Page  (Read 322 times)

Offline Ian Atienza

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Display Product Options SKU on Product Page
« on: June 04, 2020, 08:23:05 AM »
Hello all, we were able to display the SKU from the general tab of the product, but when we use product options SKU, it is not appearing on the product page. We used the code found here also on the template page (products.tpl): "<b>SKU:&nbsp</b><?php echo $product_info['sku']; ?>" Can anyone help us please on this and make the options SKU appear on the page? Many thanks in advance to this community!


« Last Edit: June 04, 2020, 08:24:48 AM by Ian Atienza »

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1840
  • Karma: +277/-11
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Display Product Options SKU on Product Page
« Reply #1 on: June 04, 2020, 08:43:46 AM »
sorry, not sure understood you right. For example you have some product option type radio or selectbox. Where sku must be shown when some value selected?
Are you talking about some js-script that shows sku of selected value of option? right?
I think the best way to customize your template (product.tpl).
You can get all options with values of product via php
Code: [Select]
<?php $product_options $this->model_catalog_product->getProductOptions($product_id); ?> and pass into your own javascript code.
Then bind "onchange" event on each form element of product options form to show sku wherever you want on page.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline Ian Atienza

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Display Product Options SKU on Product Page
« Reply #2 on: June 04, 2020, 09:17:20 AM »
Thank you for the inputs! We were successful in making the SKU appear on the product page using the "SKU input in the general tab of products", but when we inputted on the product options, it is not appearing on the product page.

<?php echo $product_info['sku']; ?> worked using the SKU input on the general tab.
« Last Edit: June 04, 2020, 09:24:41 AM by Ian Atienza »

 

Powered by SMFPacks Social Login Mod