Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
4 of 5
4
Multi Currency Addon: Call for beta testers
Posted: 18 June 2012 08:08 AM   [ Ignore ]   [ # 46 ]
Wallflower
Rank
Total Posts:  12
Joined  2012-02-27
Chris Newton - 14 June 2012 10:11 PM

Hey Myers Network, please post again on Monday and I’ll send it to you. I need to merge a view versions.

Hey Chris wondering id you had time to merge the versions?

Profile
 
 
Posted: 19 June 2012 04:38 PM   [ Ignore ]   [ # 47 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

I’ve sent you the most updated version I have.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 25 June 2012 07:56 AM   [ Ignore ]   [ # 48 ]
Wallflower
Rank
Total Posts:  12
Joined  2012-02-27
Chris Newton - 19 June 2012 04:38 PM

I’ve sent you the most updated version I have.

Hey Chris, not sure where you sent it but could you please send it again…. thx

Profile
 
 
Posted: 25 June 2012 10:33 AM   [ Ignore ]   [ # 49 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

Sent again. I emailed it to the account associated with this forum.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 02 July 2012 10:56 AM   [ Ignore ]   [ # 50 ]
Wallflower
Rank
Total Posts:  12
Joined  2012-02-27
Chris Newton - 25 June 2012 10:33 AM

Sent again. I emailed it to the account associated with this forum.

Chris not sure if the form is having issues or just my account but I can not PM or email anyone from this forum…. so can you please email me directly… thx

cartthrob AT myersnetwork DOT com

Profile
 
 
Posted: 05 July 2012 02:20 PM   [ Ignore ]   [ # 51 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

I sent you the file again.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 09 July 2012 12:43 AM   [ Ignore ]   [ # 52 ]
Wallflower
Rank
Total Posts:  12
Joined  2012-02-27

Chris got it install ok but got the following error on the front end

Error Number1054

Unknown column 
'ip' in 'where clause'

SELECT `countryFROM (`exp_ip2nation`) WHERE `ip` <= '1204006511' ORDER BY `ipdesc LIMIT 1

Filename
third_party/cartthrob_multi_location/ext.cartthrob_multi_location.php

Line Number
211 

I have EE v2.5.2 w/ CT v2.1.3 not sure if the versions have something to do with it but after looking into the code looks like the fields in the db for ip2nation is “ip_range_low”, “country”, “ip_range_high” not “ip” so that query will not work. they store bin not atom anymore, so I changed the ext.cartthrob_multi_location.php to use the ip2nation model to get the data with the following changes:

starting at line 188

if (  $this->EE->db->table_exists('ip2nation'))
  
{
    
///////////////////////////////////////////////////
   // REMOVED
   
   //if ($this->testing)
   //{
   // $ip_query = $this->EE->db->select('ip')
   //    ->where('country', strtolower($this->testing))
   //    ->order_by("ip", 'desc')
   //    ->limit("1")
   //    ->from('ip2nation')
   //    ->get();
   
     // if ($ip_query && $ip_query->num_rows() >= 1)
   // {
    //  $ip_address = $this->inet_ntoa($ip_query->row('ip')); 
    // }
     //}
    //$inet = $this->EE->db->escape_str($this->inet_aton($ip_address)); 
   
     //$query = $this->EE->db->select('country')
   //   ->where('ip <=', $inet)
   //   ->order_by("ip", 'desc')
   //   ->limit("1")
   //   ->from("ip2nation") 
    //   ->get();
   
    //if ($query && $query->num_rows() >= 1)
   //{
   
    ///////////////////////////////////////////////////
   
   // Get country code from ip2nation
   
$this->EE->load->add_package_path(APPPATH.'modules/ip_to_nation/');
   
$this->EE->load->model('ip_to_nation_data''ip_data');
   
$c_code $this->EE->ip_data->find($ip_address); 
   
   
// Bypass for testing
   
if ($this->testing)
   
{
    $c_code 
$this->testing;
   
}
   
   
if ($c_code !== FALSE)
   
{   
     
if ( ! isset($this->EE->session->cache['ip_to_nation']['countries']))
    
{
     
if ( include(APPPATH.'config/countries.php'))
     
{
      $this
->EE->session->cache['ip_to_nation']['countries'$countries;
     
}
    }
    $country_code 
=  strtoupper($c_code); 
    
// damn you UK and your alpha3 exceptions
    
if ($country_code == "UK"$country_code "GB"
   
}
   } 

however still cannot get price to change based on country….? do I need to modify the template? I will review code a bit more just diving in…. so far great job!

Profile
 
 
Posted: 10 July 2012 10:12 PM   [ Ignore ]   [ # 53 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

they store bin not atom anymore

Hah. I figured as much. I recently had someone else report a similar issue, but I hadn’t had time to research anymore. That said, I updated the file here:

https://github.com/CartThrob/addon-multi-location-settings-manager

however still cannot get price to change based on country…

OK. So, IP2NATION is completely ignored if CT finds a country_code to work with. Either a default country_code or the users actual country code. Also… I’m talking about country_code here.. not country.

to test, set up a template ilke this:

{exp:cartthrob:update_cart_form return="" }

{exp
:cartthrob:customer_info}
    {exp
:cartthrob:country_select name="country_code" selected="{customer_country_code}"}
{
/exp:cartthrob:customer_info}


<input type="submit" value="Update Cart" /> 

{/exp:cartthrob:update_cart_form}





{exp
:cartthrob:cart_total}

{exp
:cartthrob:debug_info} 

 

That’ll help see what the starting country_code and the ending country code happen to be.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 17 July 2012 12:49 AM   [ Ignore ]   [ # 54 ]
Wallflower
Rank
Total Posts:  22
Joined  2010-04-15

Hello Chris,

Can you send us the new beta currency module? We are currently starting on a multi currency shop.

Thanks,

Ruud

Profile
 
 
Posted: 17 July 2012 08:37 AM   [ Ignore ]   [ # 55 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

It’s now posted here:
https://github.com/CartThrob/addon-multi-location-settings-manager

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 18 July 2012 01:00 AM   [ Ignore ]   [ # 56 ]
Wallflower
Rank
Total Posts:  22
Joined  2010-04-15

Hello Chris,

Can you explain to me how the country settings work when using Global and European union?

Our client wants to use USD,  but EUR for a country from within the European union. At the moment price switching works when setting it up per country but when using Global and European union it always uses the GLOBAL settings.

Isn’t there an order within how the settings are used so that when Global is the first setting, this one is the default. Then when the next setting is European union, that one will override the default when the customer is located within the european union?


Hope you can explain this one for me.

Profile
 
 
Posted: 18 July 2012 06:51 AM   [ Ignore ]   [ # 57 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

Make sure to set Global as the last thing. Whatever the system finds first… it will use. If you have

USD
GLOBAL
European Union.

Global would always be used before European Union

Isn’t there an order within how the settings are used so that when Global is the first setting, this one is the default. Then when the next setting is European union, that one will override the default when the customer is located within the european union?

You have it backwards, but otherwise correct.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
Posted: 19 July 2012 12:16 AM   [ Ignore ]   [ # 58 ]
Wallflower
Rank
Total Posts:  22
Joined  2010-04-15
Chris Newton - 18 July 2012 06:51 AM

Make sure to set Global as the last thing. Whatever the system finds first… it will use. If you have

USD
GLOBAL
European Union.

Global would always be used before European Union

Isn’t there an order within how the settings are used so that when Global is the first setting, this one is the default. Then when the next setting is European union, that one will override the default when the customer is located within the european union?

You have it backwards, but otherwise correct.

 

Thanks Chris, works perfectly.

Profile
 
 
Posted: 01 August 2012 08:06 AM   [ Ignore ]   [ # 59 ]
Wallflower
Rank
Total Posts:  12
Joined  2012-02-27

I was getting the following error when using {exp:cartthrob_multi_location:price entry_id=”{entry_id}”}

Fatal errorCall to undefined method Api_cartthrob_tax_plugins::get_tax() in ./expressionengine/third_party/cartthrob_multi_location/mod.cartthrob_multi_location.php on line 51 

I could not find get_tax() in the ‘api/api_cartthrob_tax_plugins’ not sure if anyone else is having this issues but here is what I did to fix it


modify ./expressionengine/third_party/cartthrob_multi_location/mod.cartthrob_multi_location.php price() function (Starts at line 39)

First comment out the following, we will not be using the ‘api/api_cartthrob_tax_plugins’ (Line 43)

//$this->EE->load->library('api/api_cartthrob_tax_plugins'); 

Next at line 51 and line 66 comment out the following

//$price_plus_tax = $product['price'] + $this->EE->api_cartthrob_tax_plugins->get_tax($product['price']); 

and underneath them add the following

$plugin $this->EE->cartthrob->store->plugin($this->EE->cartthrob->store->config('tax_plugin'));
$price_plus_tax $product['price'$plugin->get_tax($price); 

 

all said and done your price function should look like this

public function price()
 
{
  $this
->EE->load->library('number');
  
$this->EE->load->model('product_model'); 
  
//$this->EE->load->library('api/api_cartthrob_tax_plugins');
  
  
$price 0;
  
$price_plus_tax 0
  if (
$this->EE->TMPL->fetch_param('entry_id'))
  
{
   $product 
$this->EE->product_model->get_product($this->EE->TMPL->fetch_param('entry_id')); 
   
$price =  $this->EE->number->format$product['price');
   
//$price_plus_tax = $product['price'] + $this->EE->api_cartthrob_tax_plugins->get_tax($product['price']);
   
$plugin $this->EE->cartthrob->store->plugin($this->EE->cartthrob->store->config('tax_plugin'));
   
$price_plus_tax $product['price'$plugin->get_tax($price);
   
   if (isset(
$this->EE->TMPL->tagparts[2]) && $this->EE->TMPL->tagparts[2] === 'plus_tax')
   
{
    
return $this->EE->number->format$price_plus_tax ); 
   
}
   
if (isset($this->EE->TMPL->tagparts[2]) && $this->EE->TMPL->tagparts[2] === 'plus_tax_numeric')
   
{
    
return $price_plus_tax
   
}
   }

  
if ($item $this->EE->cartthrob->cart->item($this->EE->TMPL->fetch_param('row_id')))
  
{
   $price 
=$item->price();
   
//$price_plus_tax = $price + $this->EE->api_cartthrob_tax_plugins->get_tax($price, $item);
   
$plugin $this->EE->cartthrob->store->plugin($this->EE->cartthrob->store->config('tax_plugin'));
   
$price_plus_tax $product['price'$plugin->get_tax($price);
   
   if (isset(
$this->EE->TMPL->tagparts[2]) && $this->EE->TMPL->tagparts[2] === 'plus_tax')
   
{
    
return $this->EE->number->format$price_plus_tax ); 
   
}
   
if (isset($this->EE->TMPL->tagparts[2]) && $this->EE->TMPL->tagparts[2] === 'plus_tax_numeric')
   
{
    
return $price_plus_tax
   
}
  }
  
  
if (isset($this->EE->TMPL->tagparts[2]) && $this->EE->TMPL->tagparts[2] === 'numeric')
  
{
   
return $price;
  
}
  
  
return $this->EE->number->format$price); 
 


NOTE: I do not use taxes so please make sure that this does not mess up your tax rates…

Profile
 
 
Posted: 01 August 2012 08:53 AM   [ Ignore ]   [ # 60 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  10223
Joined  2008-09-29

I believe that’s a magic method that’s essentially injected into the calling class. Basically there may be a version difference. I’ll have to test when I get a chance.

 Signature 

We’re moving away from the forums, though not entirely and not immediately. Lack of support lately is coincidental to that. Unfortunately we’ve had a bad month with it, but we do not forsee that we will have any continued problems with support through our portal going forward, or on forums while we’re still transitioning. We will send out a newsletter and make additional notifications through twitter and other outlets over the coming weeks.

Moving forward; things returning to normal.

Profile
 
 
   
4 of 5
4