Post by JNeuhoff » Fri Aug 01, 2008 1:54 am

ankur0101 wrote: in payment,
there is a Zone tab

but i want paypal

how can i do that ??
Once you have done the fix the url.php, you should see the PayPal payment module listed in the
Extensions > Payment menu. Click on the configure icon on the very right, and configure it as needed.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ankur0101 » Fri Aug 01, 2008 8:49 pm

ankur0101 wrote: so finally which version i have to choose ??

i want that 6 KG error
>> if products weight is less that 6 KG , it will show error

i want zone shipping tax which varies from country to country....
>> USA citizen will have to pay tax of $12 , Australian citizen will have to tax of $17

i want to use 6KGs weight charges
>> if goods weight is 6kg, then customer should pay $17
    if goods weight is 7kg, then customer should pay $19
    if goods weight is 8kg, then customer should pay $11
    if goods weight is 9kg, then customer should pay $17
and so on till 20KG


well when zone tax and above 6 KGs weight rate will added, then there comes final amount which consumer should pay

i got that 6 KGs criteria and coding which is in 0.7.8
finally which version i have to choose ???????????

PLEASE SIR I NEED HELP
Thank you

thank you sir,
but how can i deal with above situation
please help me

Website Hosting Mumbai Domain Registration Mumbai
Web Hosting India


New member

Posts

Joined
Tue Jul 15, 2008 6:59 pm


Post by ankur0101 » Fri Aug 01, 2008 10:46 pm

hello, sir

checkout www.vishnustores.co.cc/store/

i got paypal

but still having problem with 6kg error. ???

what i have to do ???
please help me sir.

and how can i use geo zone tax

like if package is going o USA, then it will get charged $15

if its going to australia, the it will get charged $20

like that for all countries.....
Last edited by ankur0101 on Fri Aug 01, 2008 11:10 pm, edited 1 time in total.

Website Hosting Mumbai Domain Registration Mumbai
Web Hosting India


New member

Posts

Joined
Tue Jul 15, 2008 6:59 pm


New member

Posts

Joined
Tue Jul 15, 2008 6:59 pm


Post by JNeuhoff » Sun Aug 03, 2008 6:10 am

Assuming you are using OpenCart 0.7.8:

Change your /catalog/extension/shipping/zone.php as follows:

Code: Select all

<?php 
class ShippingZone extends Shipping {    
	function __construct(&$locator) { 
		$this->address  =& $locator->get('address');
		$this->cart     =& $locator->get('cart');
		$this->config   =& $locator->get('config');
		$this->currency =& $locator->get('currency');
		$this->database =& $locator->get('database');
		$this->language =& $locator->get('language');
		$this->session  =& $locator->get('session');
		$this->tax      =& $locator->get('tax');
		$this->config   =& $locator->get('config');
		$this->weight   =& $locator->get('weight');
				
		$this->language->load('extension/shipping/zone.php');
  	}
  	

	function getWeight() {
		$language = $this->language;
		$languageId = $language->languages[$language->code]['language_id'];
		
		$total = 0;
		foreach ($this->cart->products as $product) {
			$productId = $product['product_id'];
			$weight = $this->weight->convert($product['weight'] * $product['quantity'], $product['weight_class_id'], $this->config->get('config_weight_class_id'));
			$total += $weight;
		}
		$defaultWeightClassId = $this->config->get('config_weight_class_id');
		$kgWeightClassId = 0;
		if ($row = $this->database->getRow( "select weight_class_id from `weight_class` where `unit`='kg' and language_id=$languageId;" )) {
			$kgWeightClassId = $row['weight_class_id'];
		}
		if ($kgWeightClassId == 0) {
			$error = $this->language->get('text_zone_error_unit' );
		}
		$weight = $this->weight->convert( $total, $defaultWeightClassId, $kgWeightClassId );
		return $weight;
	}



  	function quote() {
		$quote_data = array();
		
		$results = $this->database->cache('geo_zone', "select * from geo_zone order by name");
		
		foreach ($results as $result) {
   			if ($this->config->get('zone_' . $result['geo_zone_id'] . '_status')) {
   				if ($this->database->getRows("select * from zone_to_geo_zone where geo_zone_id = '" . (int)$result['geo_zone_id'] . "' and country_id = '" . (int)$this->address->getCountryId($this->session->get('shipping_address_id')) . "' and (zone_id = '" . (int)$this->address->getZoneId($this->session->get('shipping_address_id')) . "' or zone_id = '0')")) {
       				$status = true;
   				} else {
       				$status = false;
   				}
			} else {
				$status = false;
			}
			
			if ($status) {
				$cost = 0;
				
				$rates = explode(',', $this->config->get('zone_' . $result['geo_zone_id'] . '_cost'));

				foreach ($rates as $rate) {
  					$array = explode(':', $rate);
					if ($this->cart->getWeight() <= $array[0]) {
    					$cost = @$array[1];
   						break;
  					}
				}
			
      				$quote_data[$result['geo_zone_id']] = array(
        					'id'    => 'zone_' . $result['geo_zone_id'],
        					'title' => $result['name'],
        					'cost'  => $cost,
        					'text'  => $this->currency->format($this->tax->calculate($cost, $this->config->get('zone_tax_class_id'), $this->config->get('config_tax')))
      				);
			}
		}
		
		$weight = $this->getWeight();
		$method_data = array();
	
		if ($quote_data) {
      			$method_data = array(
        				'id'           => 'zone',
        				'title'        => $this->language->get('text_zone_title'),
        				'quote'        => $quote_data,
        				'tax_class_id' => $this->config->get('zone_tax_class_id'),
				'sort_order'   => $this->config->get('zone_sort_order'),
        				'error'        => (($weight < 6.0) || (weight > 20.0)) ? $this->language->get('text_zone_error_weight' ) : false
      			);
		}
		return $method_data;
  	}
}
?>
Also use the following modified /catalog/language/english/extension/shipping/zone.php file:

Code: Select all

<?php
// Text
$_['text_zone_title']         = 'Zone Shipping';
$_['text_zone_error_unit']    = "Unable to convert product weights in 'kg' units";
$_['text_zone_error_weight']  = "The weight must be at least 6 kg and no more than 20 kg.";
?>

As regards setting up Geo Zones and tax classes:

Please read Bruce's document on this which you can find at:

http://www.opencart.com/contribution/ca ... egory_id/6

and follow its instructions.
Last edited by JNeuhoff on Sun Aug 03, 2008 6:13 am, edited 1 time in total.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by ankur0101 » Sun Aug 03, 2008 2:14 pm

thank you very much sir

i will do it on my server, then i will reply

Thank you very much sir

Website Hosting Mumbai Domain Registration Mumbai
Web Hosting India


New member

Posts

Joined
Tue Jul 15, 2008 6:59 pm

Who is online

Users browsing this forum: No registered users and 2 guests