Home › Forums › Themes Support › Claue › How to add PHP code to the website?
- This topic has 1 reply, 2 voices, and was last updated 6 years, 8 months ago by Harry.
-
AuthorPosts
-
-
August 16, 2017 at 8:45 am #8307
Hello, where can I add a php code snipet I was given to track users for email abandonment campaigns?
THis is the code:
<?php
$ImageUrl = wp_get_attachment_image_src( get_post_thumbnail_id( $loop->post->ID ), ‘single-post-thumbnail’ )[0];
$ItemId = $product->id;
$Title = $product-> get_title();
$ProductUrl = “http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]”;
$Price = $product->get_price();
$RegularPrice = $product->get_regular_price();
$DiscountAmount = $RegularPrice – $Price;
$terms = get_terms( ‘product_tag’ );
?><script>
var Title = “<?php echo $Title; ?>”;
var ItemId = “<?php echo $ItemId; ?>”;
var ImageUrl = “<?php echo $ImageUrl; ?>”;
var ProductUrl = “<?php echo $ProductUrl; ?>”;
var Price = “<?php echo $Price; ?>”;
var DiscountAmount = “<?php echo $DiscountAmount; ?>”;
var RegularPrice = “<?php echo $RegularPrice; ?>”;
var _learnq = _learnq || [];_learnq.push([‘track’, ‘Viewed Product’, {
Title: Title,
ItemId: ItemId,
ImageUrl: ImageUrl,
Url: ProductUrl,
Metadata: {
Price: Price,
DiscountAmount: DiscountAmount,
RegularPrice: RegularPrice
}
}]);
</script>Thank you!
-
August 16, 2017 at 9:43 am #8308
Hi,
you can copy file header.php in claue to claue-child and insert your code.
Best regards
Harry
Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio
-
-
AuthorPosts
You must be logged in to reply to this topic.