Hikashop product link in acymailing newsletter?

  • Posts: 1119
  • Thank you received: 114
8 years 2 months ago #247830

Hi,

When creating newsletter in acymailing and adding products via tag I have bad product urls.

If SEF option in acymailing is disabled the url of product is like this:

kyra.lt/index.php?option=com_hikashop&ct...ign=test-product-url

If SEF enabled the url is like this:

kyra.lt/component/hikashop/cid-3555?utm_...ign=test-product-url

And on both product page looks bad. It is displayed on home page between all modules....Its like it doesn't have menu item for it....

Now how can I have friendly url. Like canonical I use? I think it should look something like this:

kyra.lt/sukneles/suknele-mila-juoda?utm_...ign=test-product-url

I have looked all possible configurations but couldn't find how to fix it.

Any help would be appreciated.

Thanks

Last edit: 8 years 2 months ago by kyratn.

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

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
8 years 2 months ago #247845

Hi,

Can you please confirm the HikaShop version number and the Acymailing version number you are using ?

The link you have with Acymailing do not have a Joomla menu id ; that's why you have "component/hikashop/" in the URL.
By setting product canonical in your products, the SEF URL generated can be force to use that specific value.
But the solution I would recommend would be to also set the "itemid" in the tag parameters so you will be able to choose the Joomla menu that you want to use for the links (and choose your "sukneles" menu).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 1119
  • Thank you received: 114
8 years 2 months ago #247914

Hi,

I have tried to install latest hikashop and acymailing on my test site and same results.

1.

By setting product canonical in your products, the SEF URL generated can be force to use that specific value.

I do use canonical url and in hikashop I have enabled this "Use canonical URL and generate it if missing" So my all products have canonical urls...and in newsletter it doesn't work.

2.I understand there is no menu item id. I have tried to set ID but that id would be used for all products I insert in newsletter. What if I want to send newsletter based on product categories?

3. Shouldn't canonical url be used if product has it? This is what I need.

I am just tired to add product links manually and want to create auto newsletter but it isn't working as expected for me.

Thanks

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

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
8 years 2 months ago #247919

Hi,

After analyzing in more details the plugin, it is using the function "acymailing_frontendLink" and not the "hikashop_frontendLink".
It means that it do not give in parameter the product object with the canonical url information.
So because it is not the HikaShop function which generate the URL ; it cannot have access to the canonical URL.
That's why, even if you have canonicals set, they are not used by the Acymailing plugin.

But, I can also see that the "itemid" cannot be set per tag.
The element is retrieve in the main parameters and copy in each tag element.
That's why I though the "itemid" were per tag and that it was possible to set it individually.
Unfortunately, I am not an Acymailing expert like the Acymailing team :) Even if I worked we work with they team for the core elements, they are lots of different parts in our components.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 1119
  • Thank you received: 114
8 years 2 months ago #247947

Hi,

Well, after your replay I just looked into plugin code and did some small modification.

On around line 1505 I have changed this:

$link = 'index.php?option=com_hikashop&ctrl=product&task=show&cid='.$product->product_id;

to this:
$link = $product->product_canonical;

and it is working... :cheer:

I will try to contact acymailing team and see what they will say about it.

Thanks Jerome for help.

Kind Regards

Last edit: 8 years 2 months ago by kyratn.

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

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
8 years 2 months ago #247964

Hi,

I can tell you right now that your patch is not valid for everybody.
If the product do not have a canonical or not a valid right ; it will just fail.
The usage of "hikashop_frontendLink" is the right solution ; like I already wrote.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 1119
  • Thank you received: 114
8 years 2 months ago #247985

Hi,

You are right.
I have received replay from acy team and i was told that they will take a look and give modification to hikashop team.

Thank you

Last edit: 8 years 2 months ago by kyratn.
The following user(s) said Thank You: Jerome

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

  • Posts: 1119
  • Thank you received: 114
8 years 2 months ago #248016

Hi,

I have got another problem :sick: I have added my own template in hikashop acymailing plugin for products. Using this tag: {pictHTML} generates wrong image path and no image added. Removing template image path is fine....

Example:

With tag {pictHTML} -> "/media/com_hikashop/upload/thumbnail_405x253/suknele_vogue_geltona_2.jpg"

Without tag/template -> "/media/com_hikashop/upload/thumbnail_405x270/suknele_vogue_geltona_2.jpg" which is correct path!

I have completely lost who I should contact about this so I am contacting here as for now. It seems plugin comes from hikashop install not acymailing...

Thank you

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

  • Posts: 1119
  • Thank you received: 114
8 years 2 months ago #248028

Ok, So it looks like I have fixed my previous issue. I had to change the line:

if(!empty($product->file_path)) $varFields['{pictHTML}'] = $image->display($product->file_path, false, $product->product_name);

to this:
if(!empty($product->file_path)) $varFields['{pictHTML}'] = $image->display($product->file_path, false, $product->product_name, '', '', $config->get('thumbnail_x', 100), $config->get('thumbnail_y', 100));

However I found another issue :lol:

So if product name has quotes like this: -> Dress "Vogue" <-

Image html is:
<img src="http://kyra.lt/media/com_hikashop/upload/thumbnail_405x270/dress_vogue_melyna_3.jpg" alt="Dress " vogue="" title="Dress ">

And Alt and Title is displayed wrong. I have no idea how to fix it....

Thanks

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

  • Posts: 26150
  • Thank you received: 4026
  • MODERATOR
8 years 2 months ago #248029

Hi,

That plugin is complicated because both teams can work on it.
Sometimes we are receiving patches from Acymailing team ; sometimes we are sending some to them.

So, in the plugin, you can replace :

$image = hikashop_get('helper.image');
if(!empty($product->file_path)) $varFields['{pictHTML}'] = $image->display($product->file_path, false, $product->product_name);
By :
$image = hikashop_get('helper.image');
if(!empty($product->file_path)) {
	$img = $image->getThumbnail($product->file_path);
	if($img->success)
		$varFields['{pictHTML}'] = '<img src="'.$img->url.'" alt="" title="'.htmlentities($product->product_name).'" />';
	else
		$varFields['{pictHTML}'] = $image->display($product->file_path, false, htmlentities($product->product_name));
}
In order to use the getThumbnail function which is now the common one for the thumbnail generation.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
8 years 2 months ago #248466

Hi,

Thanks Jerome for your help in this matter. You were really helpful. I have finally completed my auto-newsletter modification and all looks well. However I had to add width and height to your code.

$varFields['{pictHTML}'] = '<img src="'.$img->url.'" width="150" height="240" alt="" title="'.htmlentities($product->product_name).'" />';

Otherwise it would load default thumbnails width like 270x405 and image just gets outside of table which had width set like 150px...
It looks like loading product tag template inside other template gives a lot troubles to get it look nice.

Anyway. So my questions. Is there a way to modify code so it would be possible to crop image to my selected width?
I have looked forum but couldn't find any topic with some code hint for it.

Thanks

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 2 months ago #248478

Hi,

In that case, you'll have to create your own template and display the images yourself by calling the getThumbnail function yourself in your template:
www.acyba.com/acymailing/161-acymailing-...ashop.html#customize

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

  • Posts: 1119
  • Thank you received: 114
8 years 2 months ago #248498

Hi,

This is what I have done as per my previous posts... I have created template for hikashop product.
However image was not displayed properly with tag {pictHTML} and with Jerome help it is working now but I need to crop image if it is possible?

Thanks

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 2 months ago #248499

Hi,

Then, instead of the line:
$img = $image->getThumbnail($product->file_path);
you can have:
$img = $image->getThumbnail($product->file_path, array('width' => XX, 'height' => YY),array('default'=>true,'force_size'=>true,'scale'=>'outside'));
where XX is the width you want and YY the height you want.

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
8 years 2 months ago #248539

Thank you.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum