need to insert custom code on product page

  • Posts: 223
  • Thank you received: 1
12 years 5 months ago #51933

We are being asked by one of the company's we show on our site to include a custom code on all of their product pages. Thus far we have not been able to figure out how.

The code is:

<!--/* Channel IQ Authorized Retailer Badging JavaScript tag */--><script type="text/javascript">

if (!window.OX_ads) { OX_ads = []; }

OX_ads.push({ "auid" : "219000", "vars" : {

'PURL' : window.location.href,

'PHST' : window.location.hostname

,'fout' : 'True', 'foutd': 'Right', 'foutb': 'Hover'

,'flip' : 'True'

,'light' : 'False'

,'promo' : 'False'

,'cert' : 'False'



// * Product Page Fields //

,'Brand' : 'XXXXX'.toLowerCase()

,'MPN' :'XXXXX'

,'ProductName' :'XXXXX'

// ,'ProductPrice' : 'XXXXX'

// ,'RetailerSKU' : 'XXXXX'

// ,'Condition' : 'XXXXX'

// ,'StockStatus' : 'XXXXX'

// ,'UPC' : 'XXXXX'

// ,'ISBN' : 'XXXXX'

// ,'StyleNumber' : 'XXXXX'

// ,'CategoryPath' : 'XXXXX'

}});



</script><script type="text/javascript">

document.write('<scr'+'ipt src=" badge.channeliq.com/w/1.0/jstag "><\/scr'+'ipt>');

</script>

We are only being asked to include the first three fields at this time, which are shown above with red x's.

Two questions...

1) What code do/can we replace the x's with?

2) In which view would we place this code in so that it only appears on the items from this manufacturer?

Thanks...

Last edit: 12 years 5 months ago by plumbingdeals.

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

  • Posts: 12953
  • Thank you received: 1778
12 years 5 months ago #51956

Hello,

2. I think that you'll have to edit the show_default file of the product view of your front end template via the menu Display->Views.

Hope this will help you a little.

Last edit: 12 years 5 months ago by nicolas.

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

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 5 months ago #51983

The product name can be retrieved like that:
echo $this->element->product_name;

The brand like that:
$class = hikashop_get('class.category');
$brand = $class->get($this->element->product_manufacturer_id);
echo $brand->category_name;

I don't know what is MPN.

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

  • Posts: 223
  • Thank you received: 1
12 years 5 months ago #51984

MPN would be product code...

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

  • Posts: 12953
  • Thank you received: 1778
12 years 5 months ago #51998

The "MPN" can be retrieved like :

echo $this->element->product_code;

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

  • Posts: 223
  • Thank you received: 1
12 years 5 months ago #52043

do i need to wrap these with any php code?

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

  • Posts: 82821
  • Thank you received: 13368
  • MODERATOR
12 years 5 months ago #52130

It depends on how you add your javascript but probably yes, you will probably have to wrap them around php tags:
<?php echo $this->element->product_code; ?>

Last edit: 12 years 5 months ago by nicolas.

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

Time to create page: 0.073 seconds
Powered by Kunena Forum