Welcome,
Guest
|
With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.
It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!
Welcome,
Guest
|
|
Hello,
I'm using your Advanced Shipping by Rules extension and it works great. I just want to customize how it is displayed in the order mail. In the mail it is shown like this: Versand (Standartversand) By looking at the mail template file, it is displayed by this: <?php echo $this->orderDetails['shipmentName'];?> Name=Standartversand; Shipping=5 Versand: Standartversand I want to remove the brackets, put a colon after "Versand", put heading tags around it... Some small changes. I just can't find where this code <?php echo $this->orderDetails['shipmentName'];?> Can you help, please? |
|
Dear ex3mist,
Currently, the shipment name is hardcoded in the plugin to have the form "Methodname (Rulename)" if a rule name is present in the rule. If you want to change this, the only way is to modify the plugin itself, in particular the renderPluginname ($plugin) function in the file rules_shipping_base.php, somewhere around line 229. In particular, you need to change the current code if (!empty($plugin->rule_name)) {
$rulename=" (".htmlspecialchars($plugin->rule_name).")";
} if (!empty($plugin->rule_name)) {
$rulename=": ".htmlspecialchars($plugin->rule_name);
} Best regards, Reinhold PS: To answer your particular question: the orderDetails is set to the value generated by renderPluginName in line 131 of rules_shipping_base.php. |
|
That's exactly what I was looking for. Thank you very much for the detailed explanation!
But I'd like to ask another thing - if I want to insert only the Rulename in the order mail, can I do it by adding this code in the HTML: <?php echo $plugin->rule_name;?> |
|
Unfortunately, this is not possible. the $plugin object is only available inside the plugin code, but that will only be run when the order is submitted, not when the invoice is created. VirtueMart stores all details of an order in the $this->orderDetails array available in the templates. Unfortunately, the orderDetails contain only the shipmentName, but no other information about the shipping, in particular not the rule name.
Basically, all you can do is modify the name that the plugin returns in renderPluginName. Sorry, Reinhold |
|
Thanks once again for the detailed information!
|
|
Problem solved.
|