likeminded Posted August 17, 2010 Share Posted August 17, 2010 Ok so i have a custom payments module (for NZ using DPS) and I need to modify blockcart.tpl so i pushes the user currency through not the stores default currency, every thing i have tried either doesnt work or works but breaks my layout (right column disappears)on blockcart.tpl around line 32 is the code I have figured out i need to modify {if $cart_qties > 0}{convertPrice price=$cart->getOrderTotal(true)}{/if}some how i need to add in to use the customer currency not the stores default currency...any help greatly appreciatedLM Link to comment Share on other sites More sharing options...
likeminded Posted August 17, 2010 Author Share Posted August 17, 2010 so I need the proper formatting of this{if $cart_qties > 0}{convertPrice price=$cart->getOrderTotal(true), $currency}{/if}as that works but breaks the right side column - the one that blockcart is assigned toocan any one tell me how to write that code properly so it doesn't break the hook? Link to comment Share on other sites More sharing options...
rocky Posted August 18, 2010 Share Posted August 18, 2010 Try the following: {if $cart_qties > 0}{convertPrice price=$cart->getOrderTotal(true) currency=$currency}{/if} Link to comment Share on other sites More sharing options...
likeminded Posted August 18, 2010 Author Share Posted August 18, 2010 close rocky but still doesnt push the user currency through to the cart, le sigh Link to comment Share on other sites More sharing options...
likeminded Posted August 24, 2010 Author Share Posted August 24, 2010 any one else got any ideas? Link to comment Share on other sites More sharing options...
likeminded Posted August 24, 2010 Author Share Posted August 24, 2010 ok so in blockcart.php on starting at line 33 there is // Set currency if (!intval($params['cart']->id_currency)) $currency = new Currency(intval($params['cookie']->id_currency)); else $currency = new Currency(intval($params['cart']->id_currency)); if (!Validate::isLoadedObject($currency)) $currency = new Currency(intval(Configuration::get('PS_DEFAULT_CURRENCY'))); how do then set/pass this to blockcart.tplagain about line 32/33{if $cart_qties > 0}{convertPrice price=$cart->getOrderTotal(true)}{/if} this dont work...{if $cart_qties > 0}{convertPrice price=$cart->getOrderTotal(true) currency=$currency}{/if}can any one help me? smarty gurus, presta developers, general hacks? anyone???? Link to comment Share on other sites More sharing options...
rocky Posted August 24, 2010 Share Posted August 24, 2010 Try changing lines 48-49 of blockcart.php (in PrestaShop v1.3.1) from: $smarty->assign(array( 'products' => $products, to: $smarty->assign(array( 'cart_currency' => $currency, 'products' => $products, then use the following: {if $cart_qties > 0}{convertPrice price=$cart->getOrderTotal(true) currency=$cart_currency}{/if} This will use the currency from blockcart.php instead of the global currency. Of course, it won't work if the cart currency is the same as the global currency. Link to comment Share on other sites More sharing options...
likeminded Posted August 24, 2010 Author Share Posted August 24, 2010 Hi Rocky thanks for your reply (again) quick question do you know if this will work on an older install of presta? currently running Version 1.1.0.5 Link to comment Share on other sites More sharing options...
rocky Posted August 24, 2010 Share Posted August 24, 2010 Perhaps. I don't know. To be honest, I don't really understand what you are trying to do. I'm just writing code that matching up with what you are asking. Link to comment Share on other sites More sharing options...
likeminded Posted August 25, 2010 Author Share Posted August 25, 2010 ok so what I am trying to do is keep the user currency in the cart until the checkout process is complete,at the moment it switches currencies fine but when you go to check out it converts it back to the default shop currency, which is where my problem lies or as I have just found out if you swtich back to the default currency it stays at the "other" currency...the live site is www.me-tailtherapy.co.nzI need it to stay with the user currency (in this case AUD) rather than switching to the default currency (NZD) as I am getting payment errors on sales (customers not paying enough for a product)hope that explains it betterLM Link to comment Share on other sites More sharing options...
rocky Posted August 25, 2010 Share Posted August 25, 2010 Maybe you are making this more difficult than it needs to be. What do you have set on the Payment tab under "Currency restrictions"? Do you "Customer currency" or "Shop default currency" selected? It sounds like you might have "Shop default currency" selected when you want "Customer currency". Link to comment Share on other sites More sharing options...
likeminded Posted August 26, 2010 Author Share Posted August 26, 2010 Hi Rocky, I thought I did have that selected... Link to comment Share on other sites More sharing options...
rocky Posted August 26, 2010 Share Posted August 26, 2010 Perhaps it's a bug in your custom payment module? Are you sure that your custom payment module takes the "Customer currency" option into consideration? Can you ask the author of the module? Link to comment Share on other sites More sharing options...
likeminded Posted August 26, 2010 Author Share Posted August 26, 2010 Hmmm how would I check that... Link to comment Share on other sites More sharing options...
rocky Posted August 27, 2010 Share Posted August 27, 2010 I'm not sure, since I'm not familiar with the module. Where did you get it from? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now