Hi,
i will make subscription active again definitelly, but in this time I need find this solution before:
- on the old shop (we can't upgrade in this time) we have CSVI v. 7.20.0
- we need by import create new slug for product from product name + SKU
- we imported product name and SKU as a separate field in the template
- I tryied use plugin combine and I've merged together product name and sku into new filed slug, but this slug don't create alias
- after import:
Miloš Jakeš, Příběh komunisty-A09-141
- have to be
milos-jakes-pribeh-komunisty-a09-141
So my idea:
- find place in addon VirtueMart for CSVI (maybe ?
plugins/csviaddon/virtuemart/com_virtuemart/table/product.php
plugins/csviaddon/virtuemart/com_virtuemart/table/productlang.php
and create hack for this
is possible?
I tryied, but in productlang.php I don't have info about product_sku, then slug was only product_name
- Home »
- Support »
- Pre-sale questions »
- Create slug from product name and SKU
- easysoftware
- Pre-sale questions
- Monday, 04 March 2024
- Subscribe via email
Accepted Answer
Pending Moderation
Hello,
You can make it simple using RO CSVI Multi replace rule. Use two operations from multi replace rule, find and replace space and comma to - and use lowercase operation to change the case of words. Did you try that?
Miloš Jakeš, Příběh komunisty-A09-141
- have to be
milos-jakes-pribeh-komunisty-a09-141
You can make it simple using RO CSVI Multi replace rule. Use two operations from multi replace rule, find and replace space and comma to - and use lowercase operation to change the case of words. Did you try that?
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
- more than a month ago
- Pre-sale questions
- # 1
Accepted Answer
Pending Moderation
Hi,
I think no, because I don't know which name is used for product name
and you know - for creating slug is used spec function (in VM or CSVI) - html stripped and other function
// Decode the special characters to normal characters
$this->set('product_name', html_entity_decode($this->get('product_name'), ENT_QUOTES));
// Sanitize the product name
$this->set('product_name', filter_var($this->get('product_name'), FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_LOW));
$this->slug = $this->helper->createSlug($this->product_name);
With replace will not be efective, what do you mean?
I tryied change this code
$this->slug = $this->helper->createSlug($this->product_name);
with this:
// Create the slug
// A new alias is being created here, but we don't have an SKU to add
/*
if ($this->productTable->load($this->getState(('product_sku', false)))
{
$sku = $this->productTable->get('product_sku', 0);
$slug_new = $this->product_name . '-' . $sku;
$this->slug = $this->helper->createSlug($slug_new);
$this->log->addStats('info', 'CSVI přidalo SKU k názvu produktu do slugu');
}
else
{
$this->log->addStats('error', 'COM_CSVI_CANNOT_FIND_PRODUCT_SKU');
$this->slug = $this->helper->createSlug($this->product_name);
}
*/
but as I wrote:
I don't have SKU for adding into new slug because is not exist before import
I think no, because I don't know which name is used for product name
and you know - for creating slug is used spec function (in VM or CSVI) - html stripped and other function
// Decode the special characters to normal characters
$this->set('product_name', html_entity_decode($this->get('product_name'), ENT_QUOTES));
// Sanitize the product name
$this->set('product_name', filter_var($this->get('product_name'), FILTER_SANITIZE_SPECIAL_CHARS, FILTER_FLAG_ENCODE_LOW));
$this->slug = $this->helper->createSlug($this->product_name);
With replace will not be efective, what do you mean?
I tryied change this code
$this->slug = $this->helper->createSlug($this->product_name);
with this:
// Create the slug
// A new alias is being created here, but we don't have an SKU to add
/*
if ($this->productTable->load($this->getState(('product_sku', false)))
{
$sku = $this->productTable->get('product_sku', 0);
$slug_new = $this->product_name . '-' . $sku;
$this->slug = $this->helper->createSlug($slug_new);
$this->log->addStats('info', 'CSVI přidalo SKU k názvu produktu do slugu');
}
else
{
$this->log->addStats('error', 'COM_CSVI_CANNOT_FIND_PRODUCT_SKU');
$this->slug = $this->helper->createSlug($this->product_name);
}
*/
but as I wrote:
I don't have SKU for adding into new slug because is not exist before import
- more than a month ago
- Pre-sale questions
- # 2
Accepted Answer
Pending Moderation
I bought subscription
- more than a month ago
- Pre-sale questions
- # 3
Accepted Answer
Pending Moderation
Hello,
As I mentioned it is simpler way but if you do not know what product_name you have then write custom code to create slug. You can write the above custom code in plugins/csviaddon/virtuemart/com_virtuemart/model/import/product.php where both product_sku and product_name are available and create it as an override for import. See if that helps.
I think no, because I don't know which name is used for product name
and you know - for creating slug is used spec function (in VM or CSVI) - html stripped and other function
As I mentioned it is simpler way but if you do not know what product_name you have then write custom code to create slug. You can write the above custom code in plugins/csviaddon/virtuemart/com_virtuemart/model/import/product.php where both product_sku and product_name are available and create it as an override for import. See if that helps.
Kind regards,
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
Tharuna
=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
- more than a month ago
- Pre-sale questions
- # 4
Accepted Answer
Pending Moderation
Perfect, that is what i need
- more than a month ago
- Pre-sale questions
- # 5
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!