Post by xblackmod » Sun Sep 10, 2023 12:21 am

Hello, I hope you can help me with the following, I have tried many ways but I have not succeeded.

Basically my need is for the var product_mpn = ""; of the script to automatically read each "product-model" of each product that is entered

Is this possible?

Thanks!

Code: Select all

<script type="text/javascript">
jQuery("#DescriptionSectionOfYourPage").prepend("<div id=\"flix-inpage\"></div>");
jQuery("#AbovethefoldOfYourPage").prepend("<div id=\"flix-minisite\"></div>");
var product_mpn = "MODEL PRODUCT";
var product_ean = "Dynamically add your product EAN";
var product_brand = "Dynamically add brand name";
var distributor = "xx";
var language = "xx";
var fallback_language = "xx";
var headID = document.getElementsByTagName("head")[0];
var flixScript = document.createElement('script');
flixScript.type = 'text/javascript';
flixScript.async = true;
flixScript.setAttribute('data-flix-distributor', distributor);
flixScript.setAttribute('data-flix-language', language);
flixScript.setAttribute('data-flix-fallback-language', fallback_language);
flixScript.setAttribute('data-flix-brand', product_brand);
flixScript.setAttribute('data-flix-ean', product_ean);
flixScript.setAttribute('data-flix-mpn', product_mpn);
flixScript.setAttribute('data-flix-inpage', 'flix-inpage');
flixScript.setAttribute('data-flix-button', 'flix-minisite');
flixScript.setAttribute('data-flix-price', '');
headID.appendChild(flixScript);
flixScript.src = '//media.flixfacts.com/js/loader.js';
</script>

Newbie

Posts

Joined
Sun Sep 10, 2023 12:09 am

Post by SohBH » Sun Sep 10, 2023 4:34 pm

Code: Select all

var product_mpn = <?php echo $model; ?>;

View all extensions | Request custom work | Pricing | Contact Me


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

Post by xblackmod » Tue Sep 12, 2023 5:15 am

SohBH wrote:
Sun Sep 10, 2023 4:34 pm

Code: Select all

var product_mpn = <?php echo $model; ?>;
Thanks for the response, I tried this and other ways but they didn't work either unfortunately

Newbie

Posts

Joined
Sun Sep 10, 2023 12:09 am

Post by SohBH » Tue Sep 12, 2023 4:55 pm

Have you added it to the product.tpl file? The description 'didn't work' is quite general. Or you might want to consider paid work.

View all extensions | Request custom work | Pricing | Contact Me


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

Post by paulfeakins » Tue Sep 12, 2023 7:34 pm

xblackmod wrote:
Tue Sep 12, 2023 5:15 am
SohBH wrote:
Sun Sep 10, 2023 4:34 pm

Code: Select all

var product_mpn = <?php echo $model; ?>;
Thanks for the response, I tried this and other ways but they didn't work either unfortunately
Might need quotes around it if $model isn't a number?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 50 guests