Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Multiple Currencies Mod Complete (v4.1.2)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 08-05-2006, 06:53 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

Quote:
SQL PATCH FAILED AT QUERY:
INSERT INTO `xcart_modules` VALUES (74, 'Multiple_Currency', 'Enables users to select different currencies to be displayed.', 'Y')

Any other ideas?

Thanks,

Mike
__________________
4.1.9
Reply With Quote
  #12  
Old 08-07-2006, 11:00 AM
 
koaloa koaloa is offline
 

Member
  
Join Date: Jul 2006
Posts: 17
 

Default

Hi Mike,
Well my guess is that you already have a module with id #74 on your system. I used phpMyAdmin to export the field and it put that number in there, I should have removed it to play it safe. Anyway, I'd recommend you going into phpMyAdmin and just adding a new row into the table, leaving the 'moduleid' field empty, and filling in the other fields. Let me know if you are unsure of how to do this and I'll help you out.

Alternatively, you can run this query:

INSERT INTO `xcart_modules` (module_name,module_descr,active) VALUES ('Multiple_Currency', 'Enables users to select different currencies to be displayed.', 'Y')
__________________
X-Cart Gold v4.1.2
(running on a unix server)
Reply With Quote
  #13  
Old 08-07-2006, 12:09 PM
 
Corto_Maltese Corto_Maltese is offline
 

Advanced Member
  
Join Date: Apr 2006
Location: Canada
Posts: 33
 

Default

Hello, Koaloa,

Great mod... I have an 4.0.18 xcart version, and it is almost perfect : I have not the currencies into the drop-down list, in the top_menu.tpl.
And the same question than mffowler : what is the 'shop.php, in the 'show_currency_options.tpl'.
if you can help, it will be fantastic.
Thanks.
Erick
__________________
X-Cart 4.0.18
Telafirma Mod - Bcse Mods
Ruby Mod - Firetank Mods
Reply With Quote
  #14  
Old 08-08-2006, 07:05 PM
 
koaloa koaloa is offline
 

Member
  
Join Date: Jul 2006
Posts: 17
 

Default

Hey guys,
My reference to "shop.php" is the main shop.php script used by X-Cart. What I'm doing is causing the original page to be reloaded with the new currency values displayed (regardless of which page of the site they are on). This is not a script I've created. It's really a detail, nothing so tricky really.

If you're not getting values to appear in your combo-box I think the problem is elsewhere. Are you sure you entered the right values into the mySQL table/database? The function "func_koa_get_currency_rates" (in the "show_currency_options.tpl" file) makes a mySQL call to get all entries from the "xcart_currencies" table, but ONLY if they have a rate value that is not equal to zero (rate != '0'). This code that populates the combo is really simple. So make sure you've set these values appropriately and you should see your combo populated.

Hope this helps.
__________________
X-Cart Gold v4.1.2
(running on a unix server)
Reply With Quote
  #15  
Old 08-08-2006, 10:29 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

Koaloa-

I have the mod showing up and there are the default currency values in the mods admin area, but the dropdown is blank. There is no shop.php - can you think of ahything else that is missing?

Thanks,

- Mike
__________________
4.1.9
Reply With Quote
  #16  
Old 08-09-2006, 12:32 AM
 
koaloa koaloa is offline
 

Member
  
Join Date: Jul 2006
Posts: 17
 

Default

You're right, there is no "shop.php", I think I mistakenly put that in there, but it still works as it should because there is actually no submit button, just a javascript redirect that causes the page to reload.

Back to your problem, try putting in a print statement in the func.php file (that's part of my module) to see what it finds from the database. I'm thinking you MUST not be able to retrieve the entries from the db.

I usually use a line or two like the following:

Code:
echo "<pre>"; print_r($rows); echo "</pre>";
__________________
X-Cart Gold v4.1.2
(running on a unix server)
Reply With Quote
  #17  
Old 08-15-2006, 10:18 AM
 
Corto_Maltese Corto_Maltese is offline
 

Advanced Member
  
Join Date: Apr 2006
Location: Canada
Posts: 33
 

Default

Hi,
Just a question : why are the alter_currency rates stocked in the xcart-config table ? I do not understand well. I thought the Multiple_currency screen saved the data in the xcart-currencies table?
And, btw, I am on a 4.0.18 version. Do you think your code works well? Or do you have some idea/modification for that ? (if you have time to debug...)
Many thanks in advance
Erick
__________________
X-Cart 4.0.18
Telafirma Mod - Bcse Mods
Ruby Mod - Firetank Mods
Reply With Quote
  #18  
Old 08-18-2006, 08:15 PM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

Still no luck with this... dropdown remains empty...

Has nayone got this to woprk on 4.1.2?

Thanks,

Mike
__________________
4.1.9
Reply With Quote
  #19  
Old 08-21-2006, 10:01 AM
 
koaloa koaloa is offline
 

Member
  
Join Date: Jul 2006
Posts: 17
 

Default Re: Multiple Currencies Mod Complete (v4.1.2)

Hey guys,
This really boggles me why it's not working for you. Well let's try and debug this... my GUESS is that the script is not able to pull the values out of the database for some reason. To start, make a backup of the file /<your store dir>/skin1/customer/main/show_currency_options.tpl and REPLACE it with the following code. What I'm trying to do is just print what currency values are found in the database. Please let me know if the page prints out all of the currency rates in the database (this debug script is just for testing purposes, it will just print the values and then cause the script to terminate). Please show me your results. Thanks!

Code:
{* $Id: alter_currency_value.tpl,v 1.11.2.1 2006/04/29 06:36:56 max Exp $ *} {literal} <script language="javascript"> <!--- function SelectLink(form, url) { /*alert(document.currency_select_form.currency_options.options[document.currency_select_form.currency_options.selectedIndex].value);*/ window.location.href=url + "currency_code=" + document.currency_select_form.currency_options.options[document.currency_select_form.currency_options.selectedIndex].value; } //--> </script> {/literal} {php} // Debug Info: /* echo "<pre>"; print_r($_COOKIE); echo "</pre>"; */ $CURRENCY_RATES = func_koa_get_currency_rates(); echo "<pre>"; print_r($CURRENCY_RATES); echo "</pre>"; {/php} <form name="currency_select_form" action="nothing.php" method="post"> <select name="currency_options" onChange="SelectLink(document.currency_select_form, '{php} $url = $_SERVER['REQUEST_URI']; // remove any existing 'currency_code' variables. if(strstr($url, "currency_code")) { // we DID find the variable, so remove it! $url = preg_replace("/currency_code=[a-zA-Z]+(&)?/", "", $url); } $parsed_url = parse_url($url); if(!strstr($url, "?")) { $url .= "?"; } //echo "query is: " . $parsed_url[query] . "<br>"; if(trim($parsed_url['query']) != "") { $url = trim($url, "&"); $url .= "&"; } echo $url; {/php}')"> {php} global $smarty, $currency_code; $CURRENCY_RATES = func_koa_get_currency_rates(); if($_COOKIE[currency_code] != "") $currency_code = $_COOKIE[currency_code]; for($i = 0; $i < count($CURRENCY_RATES); $i++) { $cur_rate = $CURRENCY_RATES[$i]; $abbrev = $cur_rate->code; if($currency_code == "" && $abbrev == "USD") $selected_str = "selected=\"selected\""; if($currency_code != "" && $currency_code == $abbrev) { $selected_str = "selected=\"selected\""; $default_selected = true; } echo "<option value=\"$abbrev\" $selected_str>$abbrev</option>\n"; $selected_str = ""; } {/php} </select> </form> {php} /* echo "<pre>"; print_r($_COOKIE); echo "</pre>"; */ {/php}
__________________
X-Cart Gold v4.1.2
(running on a unix server)
Reply With Quote
  #20  
Old 08-29-2006, 06:51 AM
  bngwarehouse's Avatar 
bngwarehouse bngwarehouse is offline
 

Newbie
  
Join Date: Nov 2005
Location: Texas
Posts: 5
 

Default Re: Multiple Currencies Mod Complete (v4.1.2)

Downloaded the Module but when I try and unzip it there is a password to extract the contents. Hmmm?
__________________
X-Cart version 4.1.2 (Not Live Yet)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:33 PM.

   

 
X-Cart forums © 2001-2020