insert Hikashop TAGS with Acymailing newsletter
13 years 10 months ago #75665
by jan2
insert Hikashop TAGS with Acymailing newsletter was created by jan2
Hi,
I would like to insert a tag in a newsletter made with Acymailing
something like this : {hikashop_product:38|type:full}
When I enter the tag above in my newsletter , it is showing me the picture of the product + highest price (smallest quantity)
Is there a way to show the cheapest price (biggest quantity)
My second question is :
Is there a way to show a discounted product with a badge in Acymailing.
Br
Jan
I would like to insert a tag in a newsletter made with Acymailing
something like this : {hikashop_product:38|type:full}
When I enter the tag above in my newsletter , it is showing me the picture of the product + highest price (smallest quantity)
Is there a way to show the cheapest price (biggest quantity)
My second question is :
Is there a way to show a discounted product with a badge in Acymailing.
Br
Jan
Please Log in or Create an account to join the conversation.
13 years 10 months ago #75905
by nicolas
Replied by nicolas on topic insert Hikashop TAGS with Acymailing newsletter
Hi,
It won't be possible to display badges in newsletters.
For the price, you will have to edit the file plugins/acymailing/hikashop/hikashop.php and change the lines:
There, instead of $product->prices[0] you will want to have end($product->prices)
It won't be possible to display badges in newsletters.
For the price, you will have to edit the file plugins/acymailing/hikashop/hikashop.php and change the lines:
Code:
if($this->params->get('vat',1)){
$finalPrice = $currencyClass->format($product->prices[0]->price_value_with_tax,$product->prices[0]->price_currency_id);
}else{
$finalPrice = $currencyClass->format($product->prices[0]->price_value,$product->prices[0]->price_currency_id);
}
Please Log in or Create an account to join the conversation.
13 years 1 month ago #118365
by colpc
Replied by colpc on topic insert Hikashop TAGS with Acymailing newsletter
I understand we can create our own template as opposed to editing the default code in " hikashop.php"
this new template should be located in: media / com_acymailing / plugins and called "hikashop_product.php"
I also see on acy site there is a brief description on how to edit.
But I could use a little more detail.
can someone please provide an example of WORKING code that would be placed in the hikashop_product.php file
For me, the default template is fine! except I only wish to remove the price field.
That`s all I personally need.
Any chance someone can give us an example?
this new template should be located in: media / com_acymailing / plugins and called "hikashop_product.php"
I also see on acy site there is a brief description on how to edit.
But I could use a little more detail.
can someone please provide an example of WORKING code that would be placed in the hikashop_product.php file
For me, the default template is fine! except I only wish to remove the price field.
That`s all I personally need.
Any chance someone can give us an example?
Please Log in or Create an account to join the conversation.
13 years 1 month ago #118384
by nicolas
Replied by nicolas on topic insert Hikashop TAGS with Acymailing newsletter
You can see an example here:
www.acyba.com/forum/4-general-talk-about...t=html&lang=fr#51788
www.acyba.com/forum/4-general-talk-about...t=html&lang=fr#51788
Please Log in or Create an account to join the conversation.
13 years 1 month ago #118417
by colpc
Replied by colpc on topic insert Hikashop TAGS with Acymailing newsletter
Yes I saw that. However if you read the posts, that code does not work.
If we could see proper code, including some of the options. ( in my case
image, title, description) that would be great so we could have a place to start.
If we could see proper code, including some of the options. ( in my case
image, title, description) that would be great so we could have a place to start.
Please Log in or Create an account to join the conversation.
13 years 1 month ago #118443
by nicolas
Replied by nicolas on topic insert Hikashop TAGS with Acymailing newsletter
I read the posts and the code work as it says that you just need to change one thing in the code to make it work.
Anyway, you can simply use the code that is in the plugin:
That should work.
Anyway, you can simply use the code that is in the plugin:
Code:
<?php
$result = '';
$astyle = '';
if(empty($tag->type) || $tag->type != 'title'){
$result .= '<div class="acymailing_product">';
$astyle = 'style="text-decoration:none;" name="product-'.$product->product_id.'"';
}
$result .= '<a '.$astyle.' target="_blank" href="'.$link.'">';
if(empty($tag->type) || $tag->type != 'title') $result .= '<h2 class="acymailing_title">';
$result .= $product->product_name;
if(!empty($finalPrice)) $result .=' '.$finalPrice;
if(empty($tag->type) || $tag->type != 'title') $result .= '</h2>';
$result .= '</a>';
if(empty($tag->type) || $tag->type != 'title'){
if(!empty($product->file_path)){
$image = hikashop_get('helper.image');
$config =& hikashop_config();
$uploadFolder = ltrim(JPath::clean(html_entity_decode($config->get('uploadfolder'))),DS);
$uploadFolder = rtrim($uploadFolder,DS).DS;
$image->uploadFolder_url = str_replace(DS,'/',$uploadFolder);
$image->uploadFolder_url = ACYMAILING_LIVE.$image->uploadFolder_url;
$result .= '<table class="acymailing_content"><tr><td valign="top" style="padding-right:5px"><a target="_blank" style="text-decoration:none;border:0" href="'.$link.'" >'.$image->display($product->file_path,false,$product->product_name, '' , '' ,$config->get('thumbnail_x',100),$config->get('thumbnail_y',100)).'</a></td><td>'.$description.'</td></tr></table>';
}else{
$result .= $description;
}
}
if(empty($tag->type) || $tag->type != 'title') $result .= '</div>';
echo $result;
That should work.
The following user(s) said Thank You: colpc
Please Log in or Create an account to join the conversation.
13 years 1 month ago #118475
by colpc
Replied by colpc on topic insert Hikashop TAGS with Acymailing newsletter
Great !Thanks Nicolas. your the man
I was able to remove the price field.
And I didnt even break the whole either...
Q. I would like to increase the size of the image. I see you have to use the thumbnail
as well as a reference to X 100
I changed the 100 to 200 but I guess it still depends on the thumbnail in system.
How can alter the size to be much bigger whithin your code?
Sorry to be a pest..
I was able to remove the price field.
And I didnt even break the whole either...
Q. I would like to increase the size of the image. I see you have to use the thumbnail
as well as a reference to X 100
I changed the 100 to 200 but I guess it still depends on the thumbnail in system.
How can alter the size to be much bigger whithin your code?
Sorry to be a pest..
Please Log in or Create an account to join the conversation.
13 years 1 month ago #118492
by Xavier
Replied by Xavier on topic insert Hikashop TAGS with Acymailing newsletter
Hi,
You can probably replace:
By:
You can probably replace:
Code:
$config->get('thumbnail_x',100),$config->get('thumbnail_y',100)
Code:
'200','200'
Please Log in or Create an account to join the conversation.
Time to create page: 0.213 seconds