Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Daily Specials


Jack_mcs

Recommended Posts

Hi Jack!

 

I wondering to use your another great contrib!

 

But I must admite unappropriate work of Daily Specials. The issue is we never see discounts before visiting shopping cart. Imagine the situation when a person having a cart, he satisfied of his cart and now he proceed directly to checkout never see into shopping cart. What will we have? As I can see we have no discounts, because all of them are applied only on shopping_cart.php page. I think it is better to move the part of code from modules\daily_specials_cart.php to application_top.php reducing the server load by checking of only several actions: $HTTP_GET_VARS['action'] equal to update_product, add_product, buy_now, cust_order, clear_cart actions. So, if we move the

include_once(DIR_WS_MODULES. FILENAME_DAILY_SPECIALS_CART);

from shopping_cart.php page to application before

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

of each action described above we will apply all our discounts on every cart action.

 

What do you think about?

Link to comment
Share on other sites

  • Replies 187
  • Created
  • Last Reply

Top Posters In This Topic

Dear Heather

 

The issue with Order Editor is more complex than just to add easy_discounts into application_top of admin side.

Order Editor correctly works only on fisrt load. It displays the discount and you may edit amount manualy. But the total amount of your order will ignore your edits. Adding, deleting products will also be ignored. The problem is not in Daily Specials. The Order Editor itself was designed without support of other ot_... modules except 4 standart modules and ot_custom provided by OE itself.

 

If you don't edit the quantity of your orders, try to use this code to Daily Specials partialy work with OE:

1. COPY catalog\includes\classes\easy_discounts.php to the catalog\admin\includes\classes.

2. FIND in catalog\admin\edit_order.php

  // Include currencies class
 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

and ADD AFTER

  // easy discount
 if(file_exists(DIR_WS_CLASSES . 'easy_discount.php')){
   require(DIR_WS_CLASSES . 'easy_discount.php');
   $easy_discount = new easy_discount();
 }

 

This is should be enough to OE to understantd ot_easy_discount module. But if you try to manipulate with you ordered products the tatals will ignore Discounts. There need to be something more. I just working on. Please be patient. I have very little time to do, but hope I found the right way.

Edited by RusNN
Link to comment
Share on other sites

But I must admite unappropriate work of Daily Specials. The issue is we never see discounts before visiting shopping cart.

The discount is shown on the shopping cart page and in the shopping cart info box. I can't imagine how any customer can not know he has a discount applied with both of those.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The discount is shown on the shopping cart page and in the shopping cart info box. I can't imagine how any customer can not know he has a discount applied with both of those.

Very simple. I put a product with a disount into my cart. I doesn't see discount in the shopping cart box while I not visit my cart. If I proceed directly to checkout without visiting my cart, discounts are not applied. Discount are applied and shown everywhere (example shipping estimator box) only AFTER visiting shopping_cart.php page. Check it yourself. In my way discounts applied every time shopping cart changed.

Link to comment
Share on other sites

OK. My English is not good, so I try once more.

 

Where does discounts calculated? They phisically calculated in catalog\includes\modules\daily_specials_cart.php. Is it right? Where this module does called? In shopping_cart.php ONLY. So, if a customer NEVER open shopping_cart.php page he NEVER see his discounts.

 

Again. If a customer put something into the cart, go to the shopping_cart, discounts are applied and everything is OK. Next customer go to another product and put it into the cart. What happens? NOTHING! The shopping cart box displays the old discount. Adn only AFTER customer visit his shopping cart page again new discount will be calculated.

 

I think this should be clear to understand even with my knowledge of English.

 

I test it with Condition1 = Cart Quantity, Condition2 = Greater Than, Condition3 = 0.

Edited by RusNN
Link to comment
Share on other sites

Very simple. I put a product with a disount into my cart. I doesn't see discount in the shopping cart box while I not visit my cart. If I proceed directly to checkout without visiting my cart, discounts are not applied. Discount are applied and shown everywhere (example shipping estimator box) only AFTER visiting shopping_cart.php page. Check it yourself. In my way discounts applied every time shopping cart changed.

The contribution is written for a standard oscommerce shop, as are all of them. In a standard shop, the shopping cart box is displayed in one of the columns and the discount is shown there. If your shop doesn't use that infobox, then you will need to change the code to suit your shop.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The contribution is written for a standard oscommerce shop, as are all of them. In a standard shop, the shopping cart box is displayed in one of the columns and the discount is shown there. If your shop doesn't use that infobox, then you will need to change the code to suit your shop.

Ok, I install DS on plain osC and undersntand what you mean. Do you think is it right to goto shopping cart after each product addin to the cart? I ran out from such shop! This is rude to the customer. And the osC has an option called Display Cart After Adding Product, which prevents go to the cart each time. Set it to false and test your contrib once more. This is STANDART shop feature it DS must take it into account.

 

 

 

By the way, I just install DS on vanilly osC and have problem like Mort-Lemur asks:

Fatal error: Call to a member function count() on a non-object in N:\home\osc\www\includes\boxes\shopping_cart.php on line 64
The problem is in sesssion. I hurry to check your xplanation and run my shop before installation of DS is complte. After completing install I still got the error above, untill the session not changed.
Link to comment
Share on other sites

Ok, I install DS on plain osC and undersntand what you mean. Do you think is it right to goto shopping cart after each product addin to the cart? I ran out from such shop! This is rude to the customer. And the osC has an option called Display Cart After Adding Product, which prevents go to the cart each time. Set it to false and test your contrib once more. This is STANDART shop feature it DS must take it into account.

Having to go to the shopping cart is not required, as explained twice now.

 

 

By the way, I just install DS on vanilly osC and have problem like Mort-Lemur asks:

The problem is in sesssion. I hurry to check your xplanation and run my shop before installation of DS is complte. After completing install I still got the error above, untill the session not changed.

I've installed this contribution into a number of shops without that problem so I can only think it is a problem with the stock files you are using or the way it is being installed.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Having to go to the shopping cart is not required.

I don't think so. I am absolutely shure and never take your and my time if this be same.

But.. I spoke enough. This is your contrib and your desigion. If my help is not wishing I am shutting off.

Link to comment
Share on other sites

And for others.

 

I make Daily Specials to fully work with Order Editor contrib. All discounts are applied on product adding or deleting and editing products quantity.

 

Unfortunatelly the installation is not quite simple. Some code should be very close to catalog\includes\functions\daily_specials.php with two additional functions. But the problem with Order Editor internal cart still present. That cart does not take attribute prices into account. Because Jack will never support those changes and discounts to products with attribute applied incorrect by the time, I can't post my solution.

Link to comment
Share on other sites

  • 1 month later...

Hello

 

The contrib seems to work great so far, but

 

Im using php5 as well as mysql 5 and get following errors when removing a daily special from the shopping cart page:

 

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /xxx/yyy/includes/classes/easy_discount.php on line 25

Warning: Variable passed to each() is not an array or object in /xxx/yyy/includes/classes/easy_discount.php on line 26

Warning: reset() [function.reset]: Passed variable is not an array or object in /xxx/yyy/includes/classes/easy_discount.php on line 25

Warning: Variable passed to each() is not an array or object in /xxx/yyy/includes/classes/easy_discount.php on line 26

 

 

Then, When navigating away from the empty shopping the cart the message happens to go away sometimes but when re adding products or a daily special the ewrror reappears.

 

 

A lot of thanks in advance, any ideas would be very much appreciated

david

Link to comment
Share on other sites

The contrib seems to work great so far, but

 

Im using php5 as well as mysql 5 and get following errors when removing a daily special from the shopping cart page:

It is due to a deprecated function in the easy discount class. I haven't tested the following but I think it will fix the problem. In the includes/classes/easy_discount.php file, find

 var $discounts;

and change it to

 var (array)$discounts;

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

It is due to a deprecated function in the easy discount class. I haven't tested the following but I think it will fix the problem. In the includes/classes/easy_discount.php file, find

 var $discounts;

and change it to

 var (array)$discounts;

 

Hello Jack,

 

Thanks for replying.

 

Unfortunately this does not help:

Parse error: syntax error unexpected T_ARRAY_CAST, expecting T_VARIABLE in xxx/yyy/includes/classes/easy_discount.php on line 3

 

And all shop pages then fail to load.

david

Link to comment
Share on other sites

Hello Jack,

 

Thanks for replying.

 

Unfortunately this does not help:

Parse error: syntax error unexpected T_ARRAY_CAST, expecting T_VARIABLE in xxx/yyy/includes/classes/easy_discount.php on line 3

 

And all shop pages then fail to load.

Remove that change and find this in the same file

reset($this->discounts);

and change it to

reset((array)$this->discounts);

If that doesn't fix at least one of the problems, please let me know what version of php you are using.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Remove that change and find this in the same file

reset($this->discounts);

and change it to

reset((array)$this->discounts);

If that doesn't fix at least one of the problems, please let me know what version of php you are using.

 

I did and there are 3 instances of it, but:

 

Fatal error: Only variables can be passed by reference in /xxx/yyy/includes/classes/easy_discount.php on line 25

 

and no pages will load.

 

I have php 5.2.6-3 on linux

david

Link to comment
Share on other sites

I have php 5.2.6-3 on linux

Hmm, I'm using 5.2.9 which should fail the same way unless there is a bug in your version. But my installation works fine. If you already had Easy Discount installed, be sure to update it with the files from this contribution. Other than that, I don't think I will be able to help you since it works fine here, which means I can't see the error.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hmm, I'm using 5.2.9 which should fail the same way unless there is a bug in your version. But my installation works fine. If you already had Easy Discount installed, be sure to update it with the files from this contribution. Other than that, I don't think I will be able to help you since it works fine here, which means I can't see the error.

 

Ok,

 

I had no previous Easy Discount installed.

It must be a buggy version, so I ll have to update my local version or try it straight online.

 

thanks then.

david

Link to comment
Share on other sites

Hmm, I'm using 5.2.9 which should fail the same way unless there is a bug in your version. But my installation works fine. If you already had Easy Discount installed, be sure to update it with the files from this contribution. Other than that, I don't think I will be able to help you since it works fine here, which means I can't see the error.

 

Hi Jack,

 

I am testing it online on a PHP Version 4.4.4 and the error persists. I dont really mind just that looks very ugly for the customer when he deletes a product from his shopping cart.

you can see it online w w w . a l a r m e - d i r e c t . c h if you dont mind. I really have no clue where to look at in my code changes ...

 

Best regards

david

Link to comment
Share on other sites

I am testing it online on a PHP Version 4.4.4 and the error persists. I dont really mind just that looks very ugly for the customer when he deletes a product from his shopping cart.

you can see it online w w w . a l a r m e - d i r e c t . c h if you dont mind. I really have no clue where to look at in my code changes ...

I can't read the language so I don't know what is needed to get the discount applied. Please provide instructions and I will take a look.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I can't read the language so I don't know what is needed to get the discount applied. Please provide instructions and I will take a look.

 

the category the discount applies to is coffre-fort:

 

/coffre-fort-c-302.html?language=fr

 

When deleting one added discounted item and then clicking again the empty cart shopping_cart.php link it gives the discussed error.

 

Thanks a lot

david

Link to comment
Share on other sites

the category the discount applies to is coffre-fort:

 

/coffre-fort-c-302.html?language=fr

 

When deleting one added discounted item and then clicking again the empty cart shopping_cart.php link it gives the discussed error.

I went to that category and added an item to the cart. The discount was displayed. I then deleted that product from the cart and it worked as expected - no error. perhaps you have a cache problem?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I went to that category and added an item to the cart. The discount was displayed. I then deleted that product from the cart and it worked as expected - no error. perhaps you have a cache problem?

 

Actually the error comes once you click again on the link to the empty shopping cart or when any new item is added to the shopping cart

 

after having allready deleted a discounted item from it.

 

Thanks for having looked at it

Best regards

Edited by Eim2

david

Link to comment
Share on other sites

Thanks Jack,

 

I have removed the Daily Specials contribution until such time as I can get more info on this.

 

As I said previously I will try a post in the general forum to see if anyone has the 2 contributions working together - Im sure someone must have, as they are both popular modifications.

 

Thanks

 

Hello,

 

I am wondering if you have eventually succeeded in getting rid of this error on line 17 ...

 

Fatal error: Call to a member function count() on a non-object in includes/modules/order_total/ot_easy_discount.php on line 17

 

Best regards

david

Link to comment
Share on other sites

Hello,

 

I am wondering if you have eventually succeeded in getting rid of this error on line 17 ...

 

Fatal error: Call to a member function count() on a non-object in includes/modules/order_total/ot_easy_discount.php on line 17

 

Best regards

 

SOLVED for when using order editor :

 

Copy file catalog\includes\classes\easy_discount.php to catalog\admin\includes\classes.

 

Solution from http://www.oscommerce.com/forums/topic/54032-new-complete-order-editing-tool/page__view__findpost__p__1537239

david

Link to comment
Share on other sites

  • 5 months later...

I also have problem that the discount is not visible.

 

Here is the output:

cmp 1

def - no condition -> Cart Quantity

 

Must be something in includes/functions/daily_specials.php ... I checked all 100 times but I do not see a solution. Any new idea?

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