- Posts: 71
- Thank you received: 1
auto trim description in google product description
9 years 6 months ago #265215
by RG
auto trim description in google product description was created by RG
-- HikaShop version -- : 3.6.1
Hey,
Is it possible to automatic trim the text from the description that goes to google shopping with the Hikashop Google Products Plugin? If there are more then 5000 characters the product are not imported.
If that is not possible how can I modify the plugin while keeping the update possibilities for the rest of hikashop?
Best regards,
RG
Hey,
Is it possible to automatic trim the text from the description that goes to google shopping with the Hikashop Google Products Plugin? If there are more then 5000 characters the product are not imported.
If that is not possible how can I modify the plugin while keeping the update possibilities for the rest of hikashop?
Best regards,
RG
Please Log in or Create an account to join the conversation.
9 years 6 months ago #265217
by Jerome
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.
Replied by Jerome on topic auto trim description in google product description
Hello,
I'm afraid that HikaShop 3.6.1 is not a valid version number.
Without knowing your version number, we can't know what version of the plugin you have.
Regards,
I'm afraid that HikaShop 3.6.1 is not a valid version number.
Without knowing your version number, we can't know what version of the plugin you have.
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.
9 years 6 months ago #265270
by RG
Replied by RG on topic auto trim description in google product description
oops HikaShop Business: 3.0.1
Please Log in or Create an account to join the conversation.
9 years 6 months ago - 9 years 6 months ago #265278
by nicolas
Replied by nicolas on topic auto trim description in google product description
Hi,
You'll have to modify the code of the plugin in the file plugins/hikashop/google_products/google_products.php and change the code:
to the code:
You'll have to modify the code of the plugin in the file plugins/hikashop/google_products/google_products.php and change the code:
Code:
if(!empty($product->product_description)){
if(@$plugin->params['preview']){
$xml .= "\t".'<g:description><![CDATA[ '.strip_tags(preg_replace('#<hr *id="system-readmore" */>.*#is','',$product->product_description)).' ]]></g:description>'."\n";
}else{
$xml .= "\t".'<g:description><![CDATA[ '.strip_tags($product->product_description).' ]]></g:description>'."\n";
}
}
to the code:
Code:
if(!empty($product->product_description)){
if(@$plugin->params['preview']){
$xml .= "\t".'<g:description><![CDATA[ '.substr(strip_tags(preg_replace('#<hr *id="system-readmore" */>.*#is','',$product->product_description)),0,5000).' ]]></g:description>'."\n";
}else{
$xml .= "\t".'<g:description><![CDATA[ '.substr(strip_tags($product->product_description),0,500).' ]]></g:description>'."\n";
}
}
Last edit: 9 years 6 months ago by nicolas.
The following user(s) said Thank You: RG
Please Log in or Create an account to join the conversation.
9 years 6 months ago #266022
by RG
Replied by RG on topic auto trim description in google product description
Ok thanks I changed it. Will you also change this behavior in the plugin? Or do I need to change it with every update of hikashop?
Best regards,
RG
Best regards,
RG
Please Log in or Create an account to join the conversation.
9 years 6 months ago #266043
by nicolas
Replied by nicolas on topic auto trim description in google product description
Hi,
It will be added yes since that is a requirement of the API as per support.google.com/merchants/answer/7052112?hl=en
It will be added yes since that is a requirement of the API as per support.google.com/merchants/answer/7052112?hl=en
Please Log in or Create an account to join the conversation.
Time to create page: 0.189 seconds