Jump to content
  • Posts

    23
  • Joined

  • Last visited

About [email protected]

  • Birthday 10/31/1969

Profile Information

  • Location
    Greater Copenhagen, Denmark
  • First Name
    Henrik
  • Last Name
    Ohm Eriksen

[email protected]'s Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. A simpler solution that does not require changes to the class generator is doing a little math in the pdf template during generation: {displayPrice currency=$order->id_currency price=($order_detail.unit_price_tax_incl + $order_detail.reduction_amount_tax_incl)} /OhmegaStar
  2. Thanks bellini13 and vicOffers for the solution.. (dont prefix the hook registration with hook) /OhmegaStar
  3. Hi All, I have a (very simple) module that hooks into actionGetExtraMailTemplateVars I'd like to be able to get some additional template_vars available dependent on template and other context available. So i created a module, it installs fine, the hook is registered (i can find it in the modules / hooks overview on the action hook: hookActionGetExtraMailTemplateVars) however it seems to be either not called, or not working as expected. (I added a log statement to the method, and i would expect to see that log statement in the logs) this is the code (the entire module.php file): <?php if (!defined('_PS_VERSION_')) { exit; } class ExtraEmailFields extends Module { //constructor public function __construct() { $this->name = 'extraemailfields'; $this->version = '1.0.0'; $this->author = 'Henrik Ohm Eriksen'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.5', 'max' => _PS_VERSION_); $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('ExtraEmailFields'); $this->description = $this->l('Extra Email Fields. Adds additional email merge fields based on available content in template and template selected. Developed by Henrik Ohm Eriksen.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); } //installer public function install() { if (parent::install() == false) { return false; } $this->registerHook('hookActionGetExtraMailTemplateVars'); return true; } //uninstaller public function uninstall() { if (parent::uninstall() == false) { return false; } //Apparantly not neeeded $this->unregisterHook('hookActionGetExtraMailTemplateVars'); return true; } //Actual Hook Code public function hookActionGetExtraMailTemplateVars($params) { PrestaShopLogger::addLog('my_hook', 1); //Extract Context $template = $params['template']; $template_vars = $params['template_vars']; $extra_template_vars = $params['extra_template_vars']; $params['extra_template_vars']['{myVar1}'] = 'FOO_VAR1'; $params['extra_template_vars']['{myVar2}'] = 'FOO_VAR2'; $params['extra_template_vars']['{myVar3}'] = 'FOO_VAR3'; /*more code here temporarily commented out while troubleshooting*/ } } Anybody have an idea what I did wrong ? Regards Henrik
  4. Hi tuk66, It sounds like something close to what I need, except the full detailed product search is probably a little to much detail for us to manage. Anyway It gave me an idea about what to do about the issue. I'll basically add something to each stores name to indicate store class, and then i just need a small change to the store locator module to allow like searches on store names. Regards, Henrik
  5. Hi Nemo, Ok, thanks for clearing that up, it was not what I hoped, as keeping overrides with the theme made for easier deployment and versioning between different environments. I'll try and move the override to the correct folder to see if it then works. Regrds, Henrik
  6. Hi, I dont see - at all how the suggeste module is relevant in any way. I appreciate suggestions, but they should be relevant. Regards, Henrik
  7. Hi, I have a prestashop 1.6.x solution, i use a customized theme (based on the default-bootstrap theme) for all my customizations. I've been customizing emails, and ran into issues with the shipping emails not containing the substituion values i need. in order to add the additional substitutions, i've made an override to the /classes/order/OrderHistory.php file similar to the code below; <?phpclass OrderHistory extends OrderHistoryCore{ public function addWithemail($autodate = true, $template_vars = false, Context $context = null) { if (!$context) $context = Context::getContext(); $order = new Order($this->id_order); $data = array( '{payment}' => Tools::substr($order->payment, 0, 32), ); if ($template_vars) $data = array_merge($data, $template_vars); return parent::addWithemail($autodate, $data, $context); }} ive placed this file (OrderHistory.php) in /themes/my-theme-folder/override/classes/order/ but it seems to not work I've cleared cache, and this makes no difference. Is there something wrong with the folder structure i've used ? Best Regards OhmegaStar
  8. It turns out the rule works fine in one page checkout mode, but not in 5 step checkout. Seems like a bug to me.
  9. Hi, Our Customer service tends to be filled with by some varying communications that should be closed, in standard prestashop I can only close one item at at time. I need a module that adds a "Close Selected" Option in the bulk action menu. Anybody got any good sugggestions ? regards, Henrik
  10. Hello For Prestashop 1.6.x i need a module that allows us to provide more information to the customers about our stores. we have several classes of stores (basic selection, wide selection, full selection) We need to be able to manage this in our backoffice for each store entry, and the customer searching for a store should be able to see this information in webshop. Multilingual. Any Good suggestions ? Regards, Henrik
  11. So i tried recreating the rule, and it stil does not work in the end. :-( ill have to try adding the conditions one at a time untill it breakts then.
  12. Hi ets-soft, I'm sure all conditions are satisfied. I did have issues with the rule while configuring it, so at one point the rule had a voucher code, so users would have to add it manually. I removed the voucher code during tests of the rules. but maybe that does not relly remove it in the backend. I'll try to recrete the rule from scratch, deleting the rule that is causing issues - hopefully i can then get it to work too.. thnks for testing and verifying it works with your version. Regards, OhmegaStar
  13. Hi I have a cart rule that offers free shipping with select shippers when customer buys a specifc product. The Cart rule has no code associated so it should be applied automatically. The Cart Rule is: Country must be X (Denmark in this case) The Shipper must be three of seven options selected. Customer Group must be (visitor, Customer and other relevant groups (some groups are not elegible for this rule)) A Specific Product must be in the customer basket. The Cart Rule Action is: Free Shipping (nothing else selected) in the checkout: on page 1 the discount is mentioned in the resume as an available option, but it is not clickable as it has no code (for auto add). the shipper selection step, the free shippers correctly show up as free to the customer. but even if the customer selects one of these free shippers the order total still adds shipping cost, as if the voucher is never automatically added.... Can anybody tell me what could be the cause of this issue ? Regards OhmegaStar
  14. Thank you, Unhooking is what I want. And yes its a real strange hook to apply indiscriminatingly, /OhmegaStar
×
×
  • Create New...