- Posts: 135
- Thank you received: 2
Mass action Update product value operations
11 years 7 months ago - 11 years 7 months ago #191314
by earmaster
Mass action Update product value operations was created by earmaster
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.10
-- Error-message(debug-mod must be tuned on) -- : The table product does not exist
The table product_alias does not exist
Successfully Saved
Hi!
I'm fiddling with the Mass actions and because of how our shop is setup I need to change the products canonial URL after they are made, I intend to do this with Mass action as it can trigger after product creation.
Now the issue is that I can't get it to function as I want, I want to create the canonial url as such:
/shop/products/product-alias-here
I have tried numerous ways but I cannot figure out how. pictures below are just some of my numerous attempts
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.10
-- Error-message(debug-mod must be tuned on) -- : The table product does not exist
The table product_alias does not exist
Successfully Saved
Hi!
I'm fiddling with the Mass actions and because of how our shop is setup I need to change the products canonial URL after they are made, I intend to do this with Mass action as it can trigger after product creation.
Now the issue is that I can't get it to function as I want, I want to create the canonial url as such:
/shop/products/product-alias-here
I have tried numerous ways but I cannot figure out how. pictures below are just some of my numerous attempts
Last edit: 11 years 7 months ago by earmaster. Reason: Misleading title changed
Please Log in or Create an account to join the conversation.
11 years 7 months ago #191343
by Xavier
Replied by Xavier on topic Mass action Update product value operations
Hi,
This is not yet possible in the mass actions, but I add that on our TODO list.
For the moment, you could potentially edit the file "plugins/hikashop/massaction_product/massaction_product.php" and add:
Juste after:
And use the following syntax:
This is not yet possible in the mass actions, but I add that on our TODO list.
For the moment, you could potentially edit the file "plugins/hikashop/massaction_product/massaction_product.php" and add:
Code:
if(preg_match_all('#{(.*)}#U',$value,$matches)){
foreach($elements as $k => $element){
foreach($matches[0] as $match){
$var = str_replace(array('{','}'),'',$match);
$value = preg_replace('#'.$match.'#',$element->$var,$value);
}
}
}
Code:
$value = $this->massaction->updateValuesSecure($action,$elements,$possibleTables,$queryTables);
And use the following syntax:
product_canonical = STRING /shop/product/{product_alias}
The following user(s) said Thank You: earmaster
Please Log in or Create an account to join the conversation.
11 years 7 months ago #192202
by earmaster
Replied by earmaster on topic Mass action Update product value operations
Thanks! Worked flawlessly!
One thing tho
Looks like this for me:
It still works by placing the code below it, just though I should mention that those two lines didn't match.
(Sorry for the late reply).
One thing tho
Code:$value = $this->massaction->updateValuesSecure($action,$elements,$possibleTables,$queryTables);
Looks like this for me:
Code:
$value = $this->massaction->updateValuesSecure($action,$possibleTables,$queryTables);
It still works by placing the code below it, just though I should mention that those two lines didn't match.
(Sorry for the late reply).
Please Log in or Create an account to join the conversation.
11 years 7 months ago #192206
by Xavier
Replied by Xavier on topic Mass action Update product value operations
Hi,
Yes it's normal, I added some changes in the code on my end for testing purposes, you code is correct.
Yes it's normal, I added some changes in the code on my end for testing purposes, you code is correct.
Please Log in or Create an account to join the conversation.
Time to create page: 0.190 seconds