Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Quantity Controller v5.1


Ajeh

Recommended Posts

That is just a comment denoting the end of the function. A function has a starting { and an ending }

 

If you are getting redeclare issues you either have the functions in two different programs or the require statement or include statement to call those function files is in two different places of your code.

 

search for, and include the single quote makes for the search:

 'webmakers_added_functions.php'

 

See where this file is being loaded. It should only be loaded once in application_top.php just before the // Shopping cart section

 

At least that is where I usually put it ... :D

Link to comment
Share on other sites

  • Replies 283
  • Created
  • Last Reply

Top Posters In This Topic

Quick question - I have a Dec 2002 snapshot with the 5.1 contrib added - I am also trying to add Wishlist 1.2 - the only conflict I have found is with the changes regarding the application_top.php - the wishlist file says :

 

3) Look for this section:

 

// customer adds a product from the products page

case 'add_product' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters), 'NONSSL'));

break;

 

And replace it with this:

// customer adds a product from the products page

case 'add_product' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {

if (tep_session_is_registered('customer_id')) tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id");

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))-($cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'],$HTTP_POST_VARS['id'])))+$HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters), 'NONSSL'));

break;

 

 

can you tell me how to implement this into the application_top.php section of the adapted file to include this - here is your section:

 

// customer adds a product from the products page

case 'add_product' : if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {

if ( ($HTTP_POST_VARS['cart_quantity'] >= tep_get_products_quantity_order_min($HTTP_POST_VARS['products_id'])) or ($cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) >= tep_get_products_quantity_order_min($HTTP_POST_VARS['products_id']) ) ) {

if ( $HTTP_POST_VARS['cart_quantity']%tep_get_products_quantity_order_units($HTTP_POST_VARS['products_id'])==0 and $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+($HTTP_POST_VARS['cart_quantity']) >= tep_get_products_quantity_order_min($HTTP_POST_VARS['products_id']) ) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+($HTTP_POST_VARS['cart_quantity']), $HTTP_POST_VARS['id']);

} else {

$error_cart_msg=ERROR_PRODUCTS_QUANTITY_ORDER_UNITS_TEXT . ERROR_PRODUCTS_UNITS_INVALID . $HTTP_POST_VARS['cart_quantity'] . ' - ' . PRODUCTS_ORDER_QTY_UNIT_TEXT_INFO . ' ' . tep_get_products_quantity_order_units($HTTP_POST_VARS['products_id']);

}

} else {

$error_cart_msg=ERROR_PRODUCTS_QUANTITY_ORDER_MIN_TEXT . ERROR_PRODUCTS_QUANTITY_INVALID . $HTTP_POST_VARS['cart_quantity'] . ' - ' . PRODUCTS_ORDER_QTY_MIN_TEXT_INFO . ' ' . tep_get_products_quantity_order_min($HTTP_POST_VARS['products_id']);

}

}

if ( strlen($error_cart_msg)==0 ) {

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters), 'NONSSL'));

}

break;

 

thanks for any help!

Link to comment
Share on other sites

To be honest? That would take me an hour or more to sort out all that mess and not interfer with the other code.

 

I had enough fun just getting that code in there right in the first place ... :shock:

 

I would recommend printing that out, using Beyond Compare to highlight the differences and blend the two together.

 

Peices of code like that are why I am having such a lovely time making current updates to the code for some new features.

 

Kinda of want to shoot myself for not writting the changes with some easy to insert variables ... which I may very well resort to on the next update :D

Link to comment
Share on other sites

That is just a comment denoting the end of the function. A function has a starting { and an ending }

 

If you are getting redeclare issues you either have the functions in two different programs or the require statement or include statement to call those function files is in two different places of your code.

 

search for, and include the single quote makes for the search:

 'webmakers_added_functions.php'

 

See where this file is being loaded. It should only be loaded once in application_top.php just before the // Shopping cart section

 

At least that is where I usually put it ... :D

 

sorry i mix my application_top.php in the admin section with yours and forgot to look of the code i pasted. it was douple and its working now ( the Admin )

 

but i got still in the catalog this error:

Fatal error: Cannot redeclare tep_get_products_catagory_id() (previously declared in /home/hbinet/vhosts/business-bali/htdocs/test/catalog/catalog/includes/functions/categories_lookup.php:9) in /home/hbinet/vhosts/business-bali/htdocs/test/catalog/catalog/includes/functions/webmakers_added_functions.php on line 380

 

to look for douple entries has no success even with the application_top.php in the catalog section.

 

:oops:

Link to comment
Share on other sites

Edit the file: /catalog/includes/application_top.php

 

Search for: webmakers_added_functions.php

 

How many times is it in there?

 

Next, edit the file /catalog/includes/webmakers_added_functions.php

 

Search for: function tep_get_products_catagory_id

 

Is it in there?

 

Next, see if you have the file /catalog/includes/categories_lookup.php

 

If so, Edit the file and search for: function tep_get_products_catagory_id

 

Is it in there?

 

Next, edit the file /includes/functions/general.php

 

Search for: function tep_get_products_catagory_id

 

Is it in there?

 

Also check at the bottom of general.php if you are loading either:

 

webmakers_added_functions.php or categories_lookup.php

 

If you find this function in more than one file, it needs to be removed from all but one of them. If you are loading these files in more than one file comment out the require or include statement so that only one file loads each of the function files.

 

If you find the function more than once, you will want to make sure they are the same, which they should be, and delete the extra function.

Link to comment
Share on other sites

Hello Linda !

 

i think i got confuse with the other contributions i add already - so i desite to make new and load yours first.

 

thanx for you great help.

if i install this contribution first could you please tell me how is the syntax for the order.php in admin ???

 

i don't really understand what you mean here:

 

CHANGES TO /admin/orders.php



Admin change for Order Status to update download settings for Max days and Downloads



Add a new status Updated and set its value in the /admin/includes/languages/english/downloads_controller.php



Additional display information is included and emails include order_id in the subject

 

thank you very much for you help

Link to comment
Share on other sites

Go into the Admin ... Localization ... Order Status ... you will see there are settings for Pending, Processing, Complete

 

You want to add another one, I call mine Updated ... and then check its value in the orders_status table.

 

This value you then change in the downloads_controller.php language file so that when on an Order and you need to Update the date and number of downloads you can just use this Update setting to do so.

 

In the /includes/languages/english/downloads_controller.php file set this value to the new value in your new orders_status table which you can view with phpMyAdmin:

 

// Add a new Order Status to the orders_status table - Updated 

define('ORDERS_STATUS_UPDATED_VALUE','4'); // set to the Updated status to update max days and max count

Link to comment
Share on other sites

Well I must admin, I fought with Quanity Controller all weekend. Got it up and running 3 times. Once I failed to set up the admin correctly :( . second I got it working but then it would not give the discount :( , then third I deceided to take the Beyond Compare route and failed bad . :cry: ..

 

Now I ask .. Is anyone intrested in installing and configuring the Contro for a fee. Alot of people on the board here have done some work from me. I am fair honest person who just needs a little help. I will not bombard the message board with requests. Please send me an email privately. [email protected]

 

Damn Linda I have never been so beat up in my life ..

 

As usall Thank You in advance

 

kmcar

Link to comment
Share on other sites

Are you trying to say this is not a fun install? :shock:

 

Okay ... so maybe it's the hardest install there is ... :D

 

Writing it was a trip too. Wanted to shoot myself in the foot a couple of times over this one. Would of been way less painful.

 

But ... once it is up and running, it's great ... it's just getting it to that point ... :roll:

 

When I install it, I use Beyond Compare a lot, myself. And a lot of prayers and a few ... ummm ... words of ... well, you know what words ... :wink:

Link to comment
Share on other sites

To the almighty and powerful Linda:

 

1) please use all of your powers to persuade the masters of OSC to include all of your contributiosn in the base :wink:

 

failing that

 

2) please put all you contributions into one. I love them all but stacking them is driving me nuts. :cry:

 

3) Please build an admin interface for your contributions, would be so cool, to be able to make so many changes to osc just by changing a parameter in the Admin, and of course if the paramters were all in the DB WOW keep still my heart. :D

 

4) and last but not least can you bring ?Quantity controller 5.1 up to date, there are so many changes in the base I can't get it to work. GGGrrr.

 

These are my dreams, :D

 

Thanks

Theo.

Share your knowlege and you learn even more !

Link to comment
Share on other sites

Half the world wants these modules seperate and half the world wants them merged.

 

I will have to see what time allows as to bringing them current, yet again.

 

Unfortunately, these are rather long and encompassing programs to maintain based on individual updates so I cannot do them as often as I like as I am trying to build new features in addition to what there is now.

 

It would be great if this is all I was hired to do, but as donated Add-ons, they don't pay the rent let alone feed my cat ... :D

 

So, sometimes it is easier for you to maintain your own code.

 

Done on a regular basis this is not as bad as it seems once the code is implemented the first time.

 

I will be making some of these multiple Add-ons as they are lacking in features when only a part of them are added and other parts are not.

 

But for now, I am afraid you have to suffer the fate of updating on your own until I have time to get them to that point.

Link to comment
Share on other sites

Installed the CVS Snapshot (2.2) of yesterday and the QuantityControllerV5_0.

 

When I wanted to checkout, I received an error saying that the function get_content_type() was undefined in order.php. I found out that get_content_type was original a function in shopping_cart.php class (included by application_top.php), but the function is missing in the QuantityControllerV5_0 shopping_cart.php class.

 

I've put the function get_content_type in my current shopping_cart.php and everything works fine. (I hope :)).

Link to comment
Share on other sites

First, you should really use Quantity Controller v5.1

 

Due to the size and updates being made it is on my site right now under the Downloads category.

 

I am glad v5.0 is working for you now, but consider the upgrade.

 

Also note, contributions are only as current as the day they were zipped.

 

When additional changes are made to the code, sometimes you need to tweak them a bit to fit the new code changes.

Link to comment
Share on other sites

Linda, I have really made a mess of quantity 5.1

 

I merged it with the current release and really messed up the price calculations.

 

in Admin the price shows as this all looks good.

List = 105.00

Rebate 5.00

Price 100.00

 

quantity discounts are

10 = 95

20 = 90

 

but in the catalog well this is where the fruit salad happens

 

List Price: $105.00

$115.00

Savings of: $5.00

After Mail-in Rebate: $5.00

Save After Rebate: $100.00

 

Quantity Discounts

1-9 10-19 20+

$115.00 $109.25 $103.50

 

HELP ! PLEASE ! Pretty please with chocolate sauce and a cherry on top.

 

TY Theo

Share your knowlege and you learn even more !

Link to comment
Share on other sites

You need to configure how the savings are computed in the language file definitions.

 

There are settings on whether the savings is the List - Regular or Regular - Special etc. etc.

Link to comment
Share on other sites

Sorry Linda, but please bare with me, I must be thick today... OSC punchy!

 

but in the catalog well this is where the fruit salad happens

 

List Price: $105.00 with the 105 with a line through it.

$115.00

Savings of: $5.00

After Mail-in Rebate: $5.00

Save After Rebate: $100.00

 

Quantity Discounts

1-9 10-19 20+

$115.00 $109.25 $103.50

 

 

If the list price is $105, where does the $115 come from?

 

Can you tell me what file(s) control the pricing I looked in languages and they just have the words.

 

Thank you

Sleepless and punchie

Theo

Share your knowlege and you learn even more !

Link to comment
Share on other sites

Do you have a URL to peek at?

 

products_price_list = 105.00

products_price_rebate= 5.00

 

What is your products_price? Sounds like that is 115.00

 

In the /includes/languages/english/quantity_control.php are the settings for how you want the savings computed.

 

You need to define those methods to get the right savings to show on each line.

 

There is also a setting for whether you want the slash through the List price or not.

Link to comment
Share on other sites

Linda:

 

in Admin the price shows as this all looks good.

List = 105.00

Rebate 5.00

Price 100.00

 

quantity discounts are

10 = 95

20 = 90

 

I don't know where the $115 comes from that is the mystery :cry:

 

also the quantity Prices discounts are messed up.

 

I have made a hash of the merge some where just not sure where to start looking.

 

Thanks for your help Linda.

 

Theo

Share your knowlege and you learn even more !

Link to comment
Share on other sites

Do you have Attributes on that product?

 

Do you have Under the Products Price:

 

Price from Attributes set to Yes?

 

This means take the current price and add in the lowest attribute prices from each attribute group and show that as the price.

 

If so, you should change your default on that field to 0 so that it is set to Off or No.

Link to comment
Share on other sites

No atributes for the product. I removed all discounts, list price and rebate, price in Admin is $100 but price showing through catalog is $115.

 

I have this running at home it is not up on the web. I could tell you how to get to it but don't want to publish it here.

 

Burrying head in shame.

 

Theo

Share your knowlege and you learn even more !

Link to comment
Share on other sites

OK, I am getting a little smarter, the extra $15 is the tax, now the question is......

How do I NOT show tax included in the price, I verified that in quantity_control.php that

 

// Taxes

define('DISPLAY_PRICE_LIST_WITH_TAX','0'); // 0= off 1= on

define('DISPLAY_PRICE_REBATE_WITH_TAX','0'); // 0= off 1= on

 

So the question is where is this code used?

 

Thank you

 

Theo

Share your knowlege and you learn even more !

Link to comment
Share on other sites

Linda,

 

On a side note - sorry for the detour but I have been looking through a number of your contributions because they have similar pieces to what I am trying to do -

 

in a nutshell I am simply trying to add an additional product field - I have added the database tables with no problem -

 

The product listing shows the additional fields and allows me to sort them (in the same area as manufacture, etc.)

 

However when I try to add a new product - the new new fields do not show in the admin area and also, when I try to edit an existing product, I get this error:

 

1054 - Unknown column 'p.products_upc' in 'field list'

 

then the list of the p.products_xxx, are listed below - I added your header contrib and it worked great and the qty disc contrib as well, to name a few and they are up and running - so please Master Linda, if you have a moment and can maybe point me in a direction that would be swell....

 

thanks!

Link to comment
Share on other sites

after install ajehs great quantity controller and hours of read in the forum i stuck now :oops:

the catolog sections seems to be fine w/o my buy now button

where i can find it back ???

my problems are the admin section

its still show me in the table header by Categories / Products the message:

TABLE_HEADING_MANUFACTURERS

and my model columne is disappeared

i am helpless now

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