insert Hikashop TAGS with Acymailing newsletter

  • Posts: 88
  • Thank you received: 0
11 years 6 months ago #75665

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

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

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
11 years 6 months ago #75905

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:

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);
}
There, instead of $product->prices[0] you will want to have end($product->prices)

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

  • Posts: 77
  • Thank you received: 3
10 years 9 months ago #118365

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?

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

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
10 years 9 months ago #118384

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

  • Posts: 77
  • Thank you received: 3
10 years 9 months ago #118417

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.

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

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
10 years 9 months ago #118443

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:

<?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 .='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$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.

  • Posts: 77
  • Thank you received: 3
10 years 9 months ago #118475

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..

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

  • Posts: 13201
  • Thank you received: 2322
10 years 9 months ago #118492

Hi,

You can probably replace:

$config->get('thumbnail_x',100),$config->get('thumbnail_y',100)
By:
'200','200'

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

Time to create page: 0.077 seconds
Powered by Kunena Forum