Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Quantity Controller v5.0


Ajeh

Recommended Posts

  • Replies 72
  • Created
  • Last Reply

Top Posters In This Topic

I hate to sound thick (but I am), heres my problem. Up till now I have not been able to use phpMYAdmin (because I was on a shared server) so to make any changes to the database I have been using the backup utility in OScommerce and then editing the .sql file (sometimes not too succesfully) in a text editor.

I now have a new server and am able to use phpMYAdmin and have tried to change the prouducts table as per your instructions but keep getting syntax errors :cry:

 

Could you please tell me how to write the SQL query to make the changes needed for your mod to work below

 

Database Changes:

products table structure:



products_id  int(11)   No    auto_increment

products_quantity  int(4)   No  0  

products_model  varchar(12)   Yes  NULL  

products_image  varchar(64)   Yes  NULL  

products_bimage  varchar(64)   Yes  NULL  

products_subimage1  varchar(64)   Yes  NULL  

products_bsubimage1  varchar(64)   Yes  NULL  

products_subimage2  varchar(64)   Yes  NULL  

products_bsubimage2  varchar(64)   Yes  NULL  

products_subimage3  varchar(64)   Yes  NULL  

products_bsubimage3  varchar(64)   Yes  NULL  

products_subimage4  varchar(64)   Yes  NULL  

products_bsubimage4  varchar(64)   Yes  NULL  

products_subimage5  varchar(64)   Yes  NULL  

products_bsubimage5  varchar(64)   Yes  NULL  

products_subimage6  varchar(64)   Yes  NULL  

products_bsubimage6  varchar(64)   Yes  NULL  

products_price  decimal(15,4)   No  0.0000  

products_date_added  datetime   No  0000-00-00 00:00:00  

products_last_modified  datetime   Yes  NULL  

products_date_available  datetime   Yes  NULL  

products_weight  decimal(5,2)   No  0.00  

products_status  tinyint(1)   No  0  

products_tax_class_id  int(11)   No  0  

manufacturers_id  int(11)   Yes  NULL  

products_ordered  int(11)   No  0  

products_quantity_order_min  int(8)   No  1  

products_quantity_order_units  int(8)   No  1  

products_price_list  decimal(15,4)   No  0.0000  

products_price_rebate  decimal(15,4)   No  0.0000  

products_discount1  int(6)   No  0  

products_discount2  int(6)   No  0  

products_discount3  int(6)   No  0  

products_discount4  int(6)   No  0  

products_discount1_qty  int(6)   No  0  

products_discount2_qty  int(6)   No  0  

products_discount3_qty  int(6)   No  0  

products_discount4_qty  int(6)   No  0  

products_discounts_id  int(11)   No  0    





products_attributes table structure:



products_attributes_id  int(11)   No    auto_increment

products_id  int(11)   No  0

options_id  int(11)   No  0

options_values_id  int(11)   No  0

options_values_price  decimal(15,4)   No  0.0000

price_prefix  char(1)   No

products_options_sort_order  int(11)   No  0

Best wishes

Steve

Link to comment
Share on other sites

I'm a bit of a PHP novice and also my first post but this works.

 

paste this code into your PHPMyAdmin

 

// start

 

ALTER TABLE products ADD products_bimage varchar(64) NULL Default NULL AFTER products_image;

ALTER TABLE products ADD products_subimage1 varchar(64) NULL Default NULL AFTER products_bimage;

ALTER TABLE products ADD products_bsubimage1 varchar(64) NULL Default NULL AFTER products_subimage1;

ALTER TABLE products ADD products_subimage2 varchar(64) NULL Default NULL AFTER products_bsubimage1;

ALTER TABLE products ADD products_bsubimage2 varchar(64) NULL Default NULL AFTER products_subimage2;

ALTER TABLE products ADD products_subimage3 varchar(64) NULL Default NULL AFTER products_bsubimage2;

ALTER TABLE products ADD products_bsubimage3 varchar(64) NULL Default NULL AFTER products_subimage3;

ALTER TABLE products ADD products_subimage4 varchar(64) NULL Default NULL AFTER products_bsubimage3;

ALTER TABLE products ADD products_bsubimage4 varchar(64) NULL Default NULL AFTER products_subimage4;

ALTER TABLE products ADD products_subimage5 varchar(64) NULL Default NULL AFTER products_bsubimage4;

ALTER TABLE products ADD products_bsubimage5 varchar(64) NULL Default NULL AFTER products_subimage5;

ALTER TABLE products ADD products_subimage6 varchar(64) NULL Default NULL AFTER products_bsubimage5;

ALTER TABLE products ADD products_bsubimage6 varchar(64) NULL Default NULL AFTER products_subimage6;

ALTER TABLE products ADD products_quantity_order_min int(8) NOT NULL Default "1" AFTER products_ordered;

ALTER TABLE products ADD products_quantity_order_units int(8) NOT NULL Default "1" AFTER products_quantity_order_min;

ALTER TABLE products ADD products_price_list decimal(15,4) NOT NULL Default "0.0000" AFTER products_quantity_order_units;

ALTER TABLE products ADD products_price_rebate decimal(15,4) NOT NULL Default "0.0000" AFTER products_price_list;

ALTER TABLE products ADD products_discount1 int(6) NOT NULL Default "0" AFTER products_price_rebate;

ALTER TABLE products ADD products_discount2 int(6) NOT NULL Default "0" AFTER products_discount1;

ALTER TABLE products ADD products_discount3 int(6) NOT NULL Default "0" AFTER products_discount2;

ALTER TABLE products ADD products_discount4 int(6) NOT NULL Default "0" AFTER products_discount3;

ALTER TABLE products ADD products_discount1_qty int(6) NOT NULL Default "0" AFTER products_discount4;

ALTER TABLE products ADD products_discount2_qty int(6) NOT NULL Default "0" AFTER products_discount1_qty;

ALTER TABLE products ADD products_discount3_qty int(6) NOT NULL Default "0" AFTER products_discount2_qty;

ALTER TABLE products ADD products_discount4_qty int(6) NOT NULL Default "0" AFTER products_discount3_qty;

ALTER TABLE products ADD products_discounts_id int(11) NOT NULL Default "0" AFTER products_discount4_qty;

 

ALTER TABLE products_attributes ADD products_options_sort_order int(11) NOT NULL Default "0" AFTER price_prefix;

 

// End

 

 

cheers

barry

Link to comment
Share on other sites

OK my first post was a little screwed up, smileys appeared where they shouldn't have been here is the revised code.

 

// begin

 

ALTER TABLE products ADD products_bimage varchar(64) NULL Default NULL AFTER products_image;

ALTER TABLE products ADD products_subimage1 varchar(64) NULL Default NULL AFTER products_bimage;

ALTER TABLE products ADD products_bsubimage1 varchar(64) NULL Default NULL AFTER products_subimage1;

ALTER TABLE products ADD products_subimage2 varchar(64) NULL Default NULL AFTER products_bsubimage1;

ALTER TABLE products ADD products_bsubimage2 varchar(64) NULL Default NULL AFTER products_subimage2;

ALTER TABLE products ADD products_subimage3 varchar(64) NULL Default NULL AFTER products_bsubimage2;

ALTER TABLE products ADD products_bsubimage3 varchar(64) NULL Default NULL AFTER products_subimage3;

ALTER TABLE products ADD products_subimage4 varchar(64) NULL Default NULL AFTER products_bsubimage3;

ALTER TABLE products ADD products_bsubimage4 varchar(64) NULL Default NULL AFTER products_subimage4;

ALTER TABLE products ADD products_subimage5 varchar(64) NULL Default NULL AFTER products_bsubimage4;

ALTER TABLE products ADD products_bsubimage5 varchar(64) NULL Default NULL AFTER products_subimage5;

ALTER TABLE products ADD products_subimage6 varchar(64) NULL Default NULL AFTER products_bsubimage5;

ALTER TABLE products ADD products_bsubimage6 varchar(64) NULL Default NULL AFTER products_subimage6;

ALTER TABLE products ADD products_quantity_order_min int(8) NOT NULL Default "1" AFTER products_ordered;

ALTER TABLE products ADD products_quantity_order_units int(8) NOT NULL Default "1" AFTER products_quantity_order_min;

ALTER TABLE products ADD products_price_list decimal(15,4) NOT NULL Default "0.0000" AFTER products_quantity_order_units;

ALTER TABLE products ADD products_price_rebate decimal(15,4) NOT NULL Default "0.0000" AFTER products_price_list;

ALTER TABLE products ADD products_discount1 int(6) NOT NULL Default "0" AFTER products_price_rebate;

ALTER TABLE products ADD products_discount2 int(6) NOT NULL Default "0" AFTER products_discount1;

ALTER TABLE products ADD products_discount3 int(6) NOT NULL Default "0" AFTER products_discount2;

ALTER TABLE products ADD products_discount4 int(6) NOT NULL Default "0" AFTER products_discount3;

ALTER TABLE products ADD products_discount1_qty int(6) NOT NULL Default "0" AFTER products_discount4;

ALTER TABLE products ADD products_discount2_qty int(6) NOT NULL Default "0" AFTER products_discount1_qty;

ALTER TABLE products ADD products_discount3_qty int(6) NOT NULL Default "0" AFTER products_discount2_qty;

ALTER TABLE products ADD products_discount4_qty int(6) NOT NULL Default "0" AFTER products_discount3_qty;

ALTER TABLE products ADD products_discounts_id int(11) NOT NULL Default "0" AFTER products_discount4_qty;

 

ALTER TABLE products_attributes ADD products_options_sort_order int(11) NOT NULL Default "0" AFTER price_prefix;

 

// End

 

cheers

barry

Link to comment
Share on other sites

Thank you so much, it worked a treat and removed all the earlier probs I was having with this mod. I am really grateful to you both Barry for the above and Linda for the excellent Mod :D

 

Linda

Any news yet on showing the discounts with tax included?

Best wishes

Steve

Link to comment
Share on other sites

Hi I have found another small problem, the quantity discounts does not seem to work for prices less than 1 eg main price 0.32 price each for ten or more 0.30

It is as I described before it will apply the discounts on the preview screen but when you insert/update the product it resets all values to zero

Best wishes

Steve

Link to comment
Share on other sites

I am just doing a price comparison. I don't recall any rounding being involved in that, just a straight discount <= price type comparison.

 

Also, the current version is not setup for taxes. While I do not think that is a related issue, the v5.1 when I finish the tax part should take care of that if it is related.

 

If you lose the price on the Update in Admin, I really do not know what the error would be as these are just replaces to the database and nothing done to the prices themselves.

Link to comment
Share on other sites

Linda,

 

This contribution looks great and i am eager to get it working - here is my issue - the 2 carts I am trying to set this up with use the 11-7 and the 11-22 snapshots - I cannot get this contribution to work on either - i have gone as far as to install a new 11-22 snapshot, with no alterations and then add your contribution, but still no luck. what happens?

 

No images show in store - no outlines, boxes, nothing - like the images weren't supposed to be there - no thumbnails, either.

 

In admin area I receive lots of errors:

 

Fatal error: Call to undefined function: tep_get_free_shipper() in /home/sites/site15/web/acreativeapparel/includes/modules/shipping/freeshipper.php on line 26

 

AND/OR

 

Fatal error: Call to undefined function: tep_get_free_charger() in /home/sites/site15/web/acreativeapparel/includes/modules/payment/freecharger.php on line 25

 

Also can't seem to be able to activate any of the features anywhere ... Augh, I can only hope that maybe I can find the 11-12 snapshot or you will release the 5.1 version soon....

 

any help is greatly appreciated!!!

 

Thanks!

 

:cry:

Link to comment
Share on other sites

Sounds like you are not adding the changes to the application_top.php where you need to add the include statement for the new functions.

 

In the catelog side, it is very specific where you add that above the // Shopping cart actions

 

In the admin side, that can just be added to the bottom before the last ?>

Link to comment
Share on other sites

Looks good :D

 

Feel free to test it at:

 

http://www.thewebmakerscorner.com/snapmods_new/

 

If you login with an Ohio address the taxes are rumored to work and the new totals on the Shopping Cart are there if you buy things on sale, with discounts or rebates.

 

Now to break out all the changes and Zip them up, and maybe add a bit of documentation ...

 

Could someone please order another 12-24 hours in one day? :shock:

Link to comment
Share on other sites

Check and see if the function tep_get_categories_name is in the /admin/includes/webmakers_added_functions.php file.

 

If not, get it from the /catalog/includes/functions/webmakers_added_functions.php file and paste it in there.

 

I was looking in the admin/includes/ files and I do NOT have the webmakers+added_functions.php file - only in the catalog/includes/functions/ area.

 

Where is it?

Link to comment
Share on other sites

Hi linda,

 

Glad to hear that you have finished the mod! you are a very busy person and I am sure that everybody is thankfull for your hard work! at least I am . My question is that I am using the stable release 2.1 and I am wondering if the mod you call version 5.0 will work with that release?

 

Thanks

Sam

Link to comment
Share on other sites

Afraid not. This is written for v2.2 snapshots after November 1.

 

I have not really ever played around in v2.1 so I have no add-ons written for it.

 

I am not sure what all it would take to re-write this for v2.1 ... I am still contemplating re-writting it for v2.2 snapshots prior to November 1.

Link to comment
Share on other sites

  • 4 weeks later...
OK my first post was a little screwed up, smileys appeared where they shouldn't have been here is the revised code.

 

// begin

 

ALTER TABLE products ADD products_bimage varchar(64) NULL Default NULL AFTER products_image;

ALTER TABLE products ADD products_subimage1 varchar(64) NULL Default NULL AFTER products_bimage;

ALTER TABLE products ADD products_bsubimage1 varchar(64) NULL Default NULL AFTER products_subimage1;

ALTER TABLE products ADD products_subimage2 varchar(64) NULL Default NULL AFTER products_bsubimage1;

ALTER TABLE products ADD products_bsubimage2 varchar(64) NULL Default NULL AFTER products_subimage2;

ALTER TABLE products ADD products_subimage3 varchar(64) NULL Default NULL AFTER products_bsubimage2;

ALTER TABLE products ADD products_bsubimage3 varchar(64) NULL Default NULL AFTER products_subimage3;

ALTER TABLE products ADD products_subimage4 varchar(64) NULL Default NULL AFTER products_bsubimage3;

ALTER TABLE products ADD products_bsubimage4 varchar(64) NULL Default NULL AFTER products_subimage4;

ALTER TABLE products ADD products_subimage5 varchar(64) NULL Default NULL AFTER products_bsubimage4;

ALTER TABLE products ADD products_bsubimage5 varchar(64) NULL Default NULL AFTER products_subimage5;

ALTER TABLE products ADD products_subimage6 varchar(64) NULL Default NULL AFTER products_bsubimage5;

ALTER TABLE products ADD products_bsubimage6 varchar(64) NULL Default NULL AFTER products_subimage6;

ALTER TABLE products ADD products_quantity_order_min int(8) NOT NULL Default "1" AFTER products_ordered;

ALTER TABLE products ADD products_quantity_order_units int(8) NOT NULL Default "1" AFTER products_quantity_order_min;

ALTER TABLE products ADD products_price_list decimal(15,4) NOT NULL Default "0.0000" AFTER products_quantity_order_units;

ALTER TABLE products ADD products_price_rebate decimal(15,4) NOT NULL Default "0.0000" AFTER products_price_list;

ALTER TABLE products ADD products_discount1 int(6) NOT NULL Default "0" AFTER products_price_rebate;

ALTER TABLE products ADD products_discount2 int(6) NOT NULL Default "0" AFTER products_discount1;

ALTER TABLE products ADD products_discount3 int(6) NOT NULL Default "0" AFTER products_discount2;

ALTER TABLE products ADD products_discount4 int(6) NOT NULL Default "0" AFTER products_discount3;

ALTER TABLE products ADD products_discount1_qty int(6) NOT NULL Default "0" AFTER products_discount4;

ALTER TABLE products ADD products_discount2_qty int(6) NOT NULL Default "0" AFTER products_discount1_qty;

ALTER TABLE products ADD products_discount3_qty int(6) NOT NULL Default "0" AFTER products_discount2_qty;

ALTER TABLE products ADD products_discount4_qty int(6) NOT NULL Default "0" AFTER products_discount3_qty;

ALTER TABLE products ADD products_discounts_id int(11) NOT NULL Default "0" AFTER products_discount4_qty;

 

ALTER TABLE products_attributes ADD products_options_sort_order int(11) NOT NULL Default "0" AFTER price_prefix;

 

// End

 

cheers

barry

Link to comment
Share on other sites

  • 1 month later...

:?:

My customers shop products as guest. They click on a product which takes them to the product_info page with a signin button at the bottom of the page. When they click signin they are taken to the login.php page. Once they login they are dumped back to the default page.

 

NOTHING is added to their cart, and they aren't returned to the product they were trying to purchase SO they have to search through all the products again for what they were already looking at!

 

I would like to either change the code to where once they login it returns them to the product they were just looking at with the option of adding it to their cart - OR just have it already added it to their cart!

 

Either that, or I would like to remove the "force login to shop" and let them checkout as guest and be prompted for their needed information in order to process credit card and check out.

 

Help!!!!!! Thanks in advance!

 

Scott

Link to comment
Share on other sites

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...