Jump to content



Photo
- - - - -

[Addon] Shopping List


  • Please log in to reply
27 replies to this topic

#1   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 24 June 2014 - 04:14

This addon provides a Shopping List that your customers can use to keep track of items that they want to reorder periodically, or that they want to save for a future order. It was designed for an osCommerce store that sells consumables, but it works with any type of business that wants to increase repeat business.

Your customers can create multiple shopping lists, up to a maximum that you set in your store's Admin. Products can be added to a shopping list from a product page or from the shopping cart. Any product in a shopping list can be added to the cart, or the whole list can be added at one time. There are a full set of features that allow your customer to create, modify, delete, and view their shopping lists.


The tooltips used here are a backport from Bootstrap. I'll modify this to use the real Bootstrap tooltips when osCommerce switches to Bootstrap.

 

Screenshots:

Add a product to an existing shopping list.

Add a product to a new shopping list - step one.

Add a product to a new shopping list - step two.

After a product is added to a shopping list (confirmation)

The shopping list page.

 

Here's the code.

 

Regards

Jim


Edited by kymation, 24 June 2014 - 04:18.

See my profile for a list of my addons and ways to get support.


#2   Tsimi

Tsimi
  • Members
  • 1,766 posts
  • Real Name:Lambros
  • Gender:Male
  • Location:Japan

Posted 24 June 2014 - 06:01

Don't forget to add it inside your signature. ;)



#3   Mort-lemur

Mort-lemur
  • Members
  • 2,387 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 24 June 2014 - 07:56

@kymation Hi Jim,

 

Looks good - Just an observation from reading the install instructions - Support thread and bug reports point to your Superfish contribution threads.

 

Thanks :)


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.


#4   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 24 June 2014 - 17:13

@Tsimi  Updated; thanks for the reminder.

 

@Mort-lemur  Fixed and a new version uploaded. Thanks for the bug report.

 

Now what else did I forget?

 

Regards

Jim


See my profile for a list of my addons and ways to get support.


#5   ShaGGy

ShaGGy
  • Members
  • 113 posts
  • Real Name:Les

Posted 06 July 2014 - 22:47

@kymation Jim

 

Nice module but think i have found a bug?

 

if you update qty in the shopping list it does not appear to update the table (if I manually alter the qty in the table it reads the correct qty) just the update does not appear to do anything, also the products_name is not being populated in the shopping_lists_products table.



#6   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 06 July 2014 - 23:09

The update form seems to have the wrong action attached. I'll fix that. I'll take a look at the products_name field as well.

 

Thanks for the bug reports.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.


#7   daddybird

daddybird
  • Members
  • 2 posts
  • Real Name:Chris

Posted 07 July 2014 - 15:23

@kymation Jim

 

A couple of issues I have encountered while testing this add-on on OS 2.3.4 on my localhost machine, with SSL disabled.

 

When you are on the product_info.php page, and try to add a product to the shopping list with SSL disabled, you are redirected to https:// which doesn't exist if SSL is off.

 

I had to change 'SSL' to 'NONSSL' to make it work

 

    function dialog_add_to_list( $self_filename, $products_id, $languages_id=1, $currencies ) {

      $dialog = '    <div id="add_new_dialog" title="' . SUBTITLE_PRODUCT_EXISTING_LIST . '" class="hide">' . PHP_EOL;
      $dialog .= '      ' . tep_draw_form( 'list_add_product', tep_href_link( $self_filename, tep_get_all_get_params( array( 'action' ) ) . '&action=list_add_product', 'NONSSL' ), 'post', 'class="shopping_list"' ) . PHP_EOL;
 
Another issue:
 
When you are on the 'shopping_list.php' page, and click the 'try to add/change shopping list', trying to create a new list, nothing happens.
action=list_change_product is called but no change,  should it be action=list_new ?
 
Another issue:
 
shopping_list_id is ambiguous  
 
function id_in_shopping_list( $customers_id, $shopping_list_id, $shopping_list_products_id ) {
      $shopping_list_query_raw = "select sl.shopping_list_id from " . TABLE_SHOPPING_LIST . " sl join " . TABLE_SHOPPING_LIST_PRODUCTS . " slp on (sl.shopping_list_id = slp.shopping_list_id) where sl.customers_id = '" . (int)$customers_id . "' and sl.shopping_list_id = '" . (int)$shopping_list_id . "' and slp.shopping_list_products_id = '" . (int)$shopping_list_products_id . "'";
 
Thank you for your time.


#8   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 07 July 2014 - 16:15

1. We don't need SSL for a shopping list, so that should be changed to NONSSL as you said. However, I think your installation has an error, since https should only be used if you have SSL turned on. Check your includes/configure.php.

 

2. That works correctly on my test store. Did you enter a name for your new shopping list?

 

3. My copy shows select *. Are you using the latest version (1.0.1)?

 

Thanks for the bug reports.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.


#9   ShaGGy

ShaGGy
  • Members
  • 113 posts
  • Real Name:Les

Posted 10 July 2014 - 15:43

The update form seems to have the wrong action attached. I'll fix that. I'll take a look at the products_name field as well.

 

Thanks for the bug reports.

 

Regards

Jim

 

Hi Jim,

 

any luck with the qty not updating?

I have tried fixing it myself but couldnt get it working.



#10   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 10 July 2014 - 15:56

@ShaGGy  I'm testing the fix now. The problem was that the forms on that page were overlapping, which causes one of them to fail. The tricky part is getting the quantity field to work in both forms without overlapping the forms. This requires using Javascript to copy the field value.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.


#11   ShaGGy

ShaGGy
  • Members
  • 113 posts
  • Real Name:Les

Posted 10 July 2014 - 16:14

@ShaGGy  I'm testing the fix now. The problem was that the forms on that page were overlapping, which causes one of them to fail. The tricky part is getting the quantity field to work in both forms without overlapping the forms. This requires using Javascript to copy the field value.

 

Regards

Jim

Yes that was what i was confused about there seemed to be two things doing the same :)



#12   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 12 July 2014 - 02:05

I've updated the Addon package with fixes for all of the above bugs. Thanks to everyone who provided bug reports.

 

If you're updating from an older version, these files were changed:

/catalog/shopping_list.php

/catalog/includes/shopping_list.php

/catalog/includes/template_top.php
/catalog/includes/template_bottom.php
/catalog/includes/classes/shopping_list.php
 

Regards

Jim


See my profile for a list of my addons and ways to get support.


#13   daddybird

daddybird
  • Members
  • 2 posts
  • Real Name:Chris

Posted 12 July 2014 - 06:58

I was comparing code from Shopping List 1.0.2,  and may have found an error.  My shopping_list.php is customized, but looking at the new 1.0.2 version.
Located in catalog/shopping_list.php
 
You have moved $products_name below STOCK_CHECK , and attributes. I believe this would prevent them from displaying.
 
 
  if (STOCK_CHECK == 'true') {
            $stock_check = tep_check_stock($product_data['products_id'], $product_data['products_quantity']);
            if (tep_not_null($stock_check)) {
              $products_name .= $stock_check;
            }
          }
 
          // Get options/attributes if any
          if ( isset ($product_data['attributes']) && is_array($product_data['attributes'] ) ) {
            reset( $product_data['attributes'] );
            foreach ( $product_data['attributes'] as $attributes_value ) {
              $products_name .= '              <br /><small><i> - ' . $attributes_value['products_options_name'] . ' ' . $attributes_value['products_options_values_name'] . '</i></small>' . PHP_EOL;
            }
          }
          
          $products_name = '          <span class="td">' . $products_link . '<strong>' . $product_data['products_name'] . '</strong></a>' . PHP_EOL;
 
Thanks


#14   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 12 July 2014 - 14:39

You're right, that will fail. I'll fix that and put up a new version.

 

Thanks for the bug report.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.


#15   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 12 July 2014 - 15:42

I've uploaded a a new version to fix the bug reported by @daddybird above. If you are updating a previous install, just replace the catalog/shopping_list.php file.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.


#16   Mort-lemur

Mort-lemur
  • Members
  • 2,387 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 15 September 2014 - 12:29

Hi Jim

 a couple of questions if I may before I install this:

 

1) If a customer adds an item to the shopping list and then at some time the store owner deletes that product from the store - or makes it inactive, will it also be removed from shopping lists?

 

2) Could the shopping lists be renamed "wish lists" or something? during install


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.


#17   joli1811

joli1811

    Anybody seen this leprechaun say yeah !!

  • Members
  • 2,384 posts
  • Real Name:john dunlop
  • Gender:Male
  • Location:Ireland

Posted 15 September 2014 - 15:33

@Mort-lemur

 

Think I maybe had problems with the option_types and shopping cart list not 100% sure but 99%

 

so do on a test site first if it is one of your option sites

 

Regards

John


To improve is to change; to be perfect is to change often.

#18   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 15 September 2014 - 15:51

@Mort-lemur

  1. No. It should not be removed, but there should be a notice that it is no longer available. I'll add that. Thanks for bringing it to my attention.
  2. Yes, but you should probably be using the Wish List addon. They are designed to do different things.

@joli1811

Yes, you would need to modify the Shopping List to work with Option Types.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.


#19   beemertec

beemertec
  • Members
  • 30 posts
  • Real Name:Steve Andrews

Posted 06 November 2014 - 20:05

Jim,

 

Will this add-on work with v2.2 or only 2.3?

 

Thanks,

Steve



#20   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 9,676 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 06 November 2014 - 21:21

I've never tried, but it should be possible to make it work. Since this addon uses modern code, it's probably going to look a bit odd on your old store.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.