Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Multi Pickup


Guest

Recommended Posts

This module works like the pickup shipping method

+ you can have multiple stores (pickup addresses)

+ still works for 1 store

+ adjusts the delivery address to the address of the selected shop

+ stores can be added in the admin

Link to comment
Share on other sites

  • 4 weeks later...

HELP!!

 

I have installed your package but get the following error when in the admin/catalog/stores option

 

1146 - Table 'test.stores' doesn't exist

 

select count(*) as total FROM stores

 

[TEP STOP]

 

This is from the stores.php page

 

Can you assist please?

 

Cheers

 

Edward :roll:

Link to comment
Share on other sites

Warning: Cannot modify header information - headers already sent by (output started at /home/customers/i/n/t/intekcommunications.net/shopadmin/includes/application_top.php:587) in /home/customers/i/n/t/intekcommunications.net/shopadmin/includes/functions/general.php on line 18

 

 

Any ideas?

 

is this the suspect bit of code off line 18 in general.php?

 

header('Location: ' . $url);

 

 

Blinding mod if i can get him working!

Link to comment
Share on other sites

Sorry guys, I am skiing in the alps right now....

So I will get back to you when i am back home (tuesday next week)...

 

Edward, you should run the sql statement included in the download that creates the table

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 5 months later...

Thanks for the nice contribution. I have it in MS2 and the address is somehow giving my tax computation a problem. If I ship UPS to myself I get charged 7.75% sales tax but if Store Pickup is indicated no tax is added.

 

Thanks for the careful documentation. It is my 10th contribution install and the best documentation of the 10.

Link to comment
Share on other sites

  • 1 month later...

Hi, Thank for this module, but i have an error >_<

 

1062 - Duplicate entry '2' for key 1

 

insert into address_book (entry_firstname, entry_lastname, entry_street_address, entry_postcode, entry_city, entry_country_id, entry_company, entry_suburb, entry_state, entry_zone_id, customers_id, address_book_id) values ('A Definir', 'A Definir', '8 Rue Barbaroux', '83170', 'Brignoles', '73', 'CyberEspace Ourson Surfeur', '', '', '85', '0', '2')

 

[TEP STOP]

 

I'm on MS2 ...

 

Anyone could help me ??

 

Thank

Edited by ShinXP
Link to comment
Share on other sites

  • 1 month later...

I have a problem using this excellent contribution with taxe/zones: the taxes are not applied because the address is emptied out at some point when it is replaced by the shop's address (I think).

 

Can you help ?

 

thanks,

Link to comment
Share on other sites

Try this:

 

1. Open file admin/stores.php

2. Find the line that starts with

$max=tep_db_fetch_array(tep_db_query("

 

3. Replace the entire line with this line:

$max=tep_db_fetch_array(tep_db_query("select max(s.stores_id)+1 as max_stores_id, max(a.address_book_id)+1 as max_address_id FROM " . TABLE_ADDRESS_BOOK . " a, " . TABLE_STORES . " s"));

 

Good luck! :D

Link to comment
Share on other sites

  • 2 months later...

This mod actually works great for my needs.

I created a page to display the different pickup locations dynamically and link to a yahoo map for the location.

 

At this time it is a crude looking hack for a cart I'm working on. Its MS2 with BTS and some other mods, so you may need to modify it to fit for you. The map feature works for US only. To change for your location visit yahoomaps.

 

<table>
<?php    
 $sql = "select s.*, a.*, z.* from stores s, address_book a, zones z where s.address_book_id = a.address_book_id and a.customers_id = 0 and z.zone_id = a.entry_zone_id";
 $qstores = tep_db_query($sql);
 
 while ($store = tep_db_fetch_array($qstores)) {
	 $company = $store['entry_company'];
	 $street = $store['entry_street_address'];
	 $city = $store['entry_city'];
	 $state = $store['zone_name'];
	 $zip = $store['entry_postcode'];
     
	 $map = "http://us.rd.yahoo.com/maps/us/insert/Tmap/extmap/*-http://maps.yahoo.com/maps_result?addr=" . urlencode($street) . "&csz=" . urlencode($city) . "," . urlencode($state) . "%20" . urlencode($zip);
   
	 echo "<tr>";
	 echo "<td class=\"boldmain\">" . $company . "</td>";
	 echo "</tr><tr>";
	 echo "<td class=\"main\">" . $street . "</td>";
	 echo "<td class=\"main\">" . $city . "</td>";
	 echo "<td class=\"main\">" . $state . "</td>";
	 echo "<td class=\"main\">" . $zip . "</td>";
	 echo "<td class=\"main\"><a href=". $map . " target=\"_blank\">Map it</a></td>";
	 echo "</tr>";
 }
   
?>
 </table>

Link to comment
Share on other sites

  • 3 weeks later...
  • 9 months later...

I am using the Multi Pickup (MS1) on my (somewhat modified) installation of MS2. After some pain and suffering, I have managed to get the contribution to deal with the tax elements properly (at least on my installation :-))

 

In the hope that I can help someone avoid the same pain, here are the changes I made. Use them entirely at your own risk!

 

I have assumed that you have installed the Multi Pickup (MS1) 1.0 contribution exactly as per install instructions. Now....

 

1. In /catalog/includes/classes/order.php locate the following section:

 

    // for multiple pickup... delivery is one of the company addresses

   $arrship=explode('_',$shipping['id']);

   if($arrship[0]=='multipickup'){

     $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '0' and ab.address_book_id = '" . $sendto . "'");

   }else{

     $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . $customer_id . "' and ab.address_book_id = '" . $sendto . "'");

   }

   // eo for multiple pickup... delivery is one of the company addresses

 

2. Replace it with the following:

 

    // for multiple pickup... delivery is one of the company addresses

   $arrship=explode('_',$shipping['id']);

   if($arrship[0]=='multipickup'){

     $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '0' and ab.address_book_id = '" . (int)$sendto . "'");

   }else{

     $shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)$sendto . "'");

   }

   // eo for multiple pickup... delivery is one of the company addresses

 

3. In the same file, just a bit further on, locate the following:

 

      $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'");

 

4. Replace it with the following (be very careful - only replace the section identified above!):

 

    // for multiple pickup... delivery is one of the company addresses
   $arrship=explode('_',$shipping['id']);

   if($arrship[0]=='multipickup'){
     $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '0' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'");
   }else{

     $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto : $sendto) . "'");
   }
   // eo for multiple pickup... delivery is one of the company addresses

 

If you look carefully, you will see that the only changes I have made are to change the $customer_id to (int)$customer_id and $sendto to (int)$send_to in the shipping_address_query and then to apply the same logic to the tax_address_query. It worked for me, hopefully it will work for you. Good Luck!!

 

PS Nothing to do with the tax elements, but make sure you have followed the changes recommended by this post

 

http://www.oscommerce.com/forums/index.php?sho...ndpost&p=321224

 

and you will have a great contribution working on your site!

Link to comment
Share on other sites

  • 4 months later...

Hi all,

 

I've set this up and it's allowing me to add stores etc..

 

Only thing is I can't see where you select the pickup as a shipping method when checking out??

 

Do I need to have several shipping modules installed, or just one particular one?

 

I'm probably just being stupid again ;)

 

Cheers,

 

Dan

Link to comment
Share on other sites

  • 2 months later...

Right - I've got this working great for one store, but I want to set up more stores, and limit which are visible to the customer depending on which 'zone' they select when they register.

 

The Admin tool lets me assign each store a zone, but they're all shown to the customer at checkout.

 

Is there a way to limit the stores shown to the customer, based on this Zone setting?

 

This would make my day ;)

 

Thanks,

 

Dan :)

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...