- Posts: 223
- Thank you received: 1
need to insert custom code on product page
- plumbingdeals
-
Topic Author
- Offline
Less
More
14 years 4 months ago - 14 years 4 months ago #51933
by plumbingdeals
need to insert custom code on product page was created by plumbingdeals
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...
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: 14 years 4 months ago by plumbingdeals.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
14 years 4 months ago - 14 years 4 months ago #51956
by Mohamed Thelji
Replied by Mohamed Thelji on topic Re: need to insert custom code on product page
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.
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: 14 years 4 months ago by nicolas.
Please Log in or Create an account to join the conversation.
14 years 4 months ago #51983
by nicolas
Replied by nicolas on topic Re: need to insert custom code on product page
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.
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.
- plumbingdeals
-
Topic Author
- Offline
Less
More
- Posts: 223
- Thank you received: 1
14 years 4 months ago #51984
by plumbingdeals
Replied by plumbingdeals on topic Re: need to insert custom code on product page
MPN would be product code...
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
14 years 4 months ago #51998
by Mohamed Thelji
Replied by Mohamed Thelji on topic Re: need to insert custom code on product page
The "MPN" can be retrieved like :
Code:
echo $this->element->product_code;
Please Log in or Create an account to join the conversation.
- plumbingdeals
-
Topic Author
- Offline
Less
More
- Posts: 223
- Thank you received: 1
14 years 4 months ago #52043
by plumbingdeals
Replied by plumbingdeals on topic Re: need to insert custom code on product page
do i need to wrap these with any php code?
Please Log in or Create an account to join the conversation.
14 years 4 months ago - 14 years 4 months ago #52130
by nicolas
Replied by nicolas on topic Re: need to insert custom code on product page
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; ?>
<?php echo $this->element->product_code; ?>
Last edit: 14 years 4 months ago by nicolas.
Please Log in or Create an account to join the conversation.
Time to create page: 0.205 seconds