Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Daily Specials


Jack_mcs

Recommended Posts

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?

No idea what this is about without details. What are the conditions of the sale you have setup? What oscommerce version do you have? Are you seeing the banner?

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

  • Replies 187
  • Created
  • Last Reply

Top Posters In This Topic

No idea what this is about without details. What are the conditions of the sale you have setup? What oscommerce version do you have? Are you seeing the banner?

 

1. Condition 1 (Cart Quantity), Condition 2 (Greater Than), Condition 3 (1), Coupon Amount 55%, Products (4420)

2. oscommerce 2.2

3. Yes, banner is visible.

4. I tried also with other conitions, without success.

5. After all of that, the problem is that my shop side cannot see the definitons ...

Link to comment
Share on other sites

1. Condition 1 (Cart Quantity), Condition 2 (Greater Than), Condition 3 (1), Coupon Amount 55%, Products (4420)

2. oscommerce 2.2

3. Yes, banner is visible.

4. I tried also with other conitions, without success.

5. After all of that, the problem is that my shop side cannot see the definitons ...

What happens if you change it to cart total? Remove the product? Have you tried any other settings? Does the included example work once you change the stop date?

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

What happens if you change it to cart total? Remove the product? Have you tried any other settings? Does the included example work once you change the stop date?

 

I tried all possible settings ... Included example also does not show discounts, only banner.

Link to comment
Share on other sites

I tried all possible settings ... Included example also does not show discounts, only banner.

Have you enabled the module in the settings?

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 came to the following conclusions.

Something is wrong with cases in file modules/daily_specials_cart.php ...

If I copy

if ($comparison) 
{
$easy_discount->set('DS_CQTY'.$ds['special_name'],$ds['special_name'],$amt);
$dsClear = false;
} else {
$easy_discount->clear('DS_CQTY'.$ds['special_name']);
}

under default: discounts appear ...

Link to comment
Share on other sites

Resolved

This is a working code ->modules/daily_specials_cart.php ... (no matter what language you are using)

 

<?php
/*
 $Id: daily specials, v 1.1 2009/09/01 by Jack_mcs
 Created by Jack_mcs from http://www.oscommerce-solution.com

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce
 Portions Copyright 2009 oscommerce-solution.com

 Released under the GNU General Public License
*/
 include_once(DIR_WS_FUNCTIONS.FILENAME_DAILY_SPECIALS);
 $dsClear = true;

 if (DAILY_SPECIALS_ENABLE == 'true')
 {
    $ds_query = tep_db_query("select unique_id, special_name, page_type, page_text, popup_text, alt_text, image, categories, pages, products_list, condition1, condition2, condition3, coupon_amount, date_start, date_stop, recur_days, recur_mode, test_mode, use_css, language_id from " . TABLE_DAILY_SPECIALS . " where date_start <= current_date() and date_stop >= current_date() and ( language_id = 99 or language_id = '" . (int)$languages_id . "')");

    if (tep_db_num_rows($ds_query) > 0)
    {
       $amt = 0;
       while ($ds = tep_db_fetch_array($ds_query))
       {
          if (OKToContinue($ds['test_mode'], $customer_id)) //not in test mode or in test mode and shop owner logged in
          {
             $comparison = CheckConditions($ds, $cart, $amt);
// echo 'result '.$ds['condition1'] ;
             switch ($ds['condition1'])
          {


                case 'Cart Total' :
                   if ($comparison) 
                   {
                       $easy_discount->set('DS_CTTL',$ds['special_name'], $amt);
                       $dsClear = false;
                   } else {
                       $easy_discount->clear('DS_CTTL'.$ds['special_name']);
                   }
                   break;

                case 'Cart Quantity' :
                   if ($comparison) 
                   {
                       $easy_discount->set('DS_CQTY'.$ds['special_name'],$ds['special_name'],$amt);
                       $dsClear = false;
                   } else {
                       $easy_discount->clear('DS_CQTY'.$ds['special_name']);
                   }
                   break;

                default:  //just displaying a banner //echo 'ERROR: No definition found -> '. $ds['condition1'];  

             }            
          }
       }
    }
 }  

 if ($dsClear)
 {
     if ($easy_discount->count() > 0) 
     {
         $easy_discount->clear('DS_CTTL', true);
         $easy_discount->clear('DS_CQTY', true);
     }
 }
?>  

Link to comment
Share on other sites

Bug: Start Date and Stop Date

 

Example:

Start Date: 2011-03-31

Stop Date: 2011-04-01

Campaign continues to show up to 2011-04-02, basically 24 hours more. I tried multiple dates.

I insert the code to check dates, dates are correct.

<?php echo 'From: ' .tep_date_long($ds['date_start']) ?>
<?php echo ' To: ' .tep_date_long($ds['date_stop']) ?>

Link to comment
Share on other sites

Bug: Start Date and Stop Date

 

Example:

Start Date: 2011-03-31

Stop Date: 2011-04-01

Campaign continues to show up to 2011-04-02, basically 24 hours more. I tried multiple dates.

I insert the code to check dates, dates are correct.

<?php echo 'From: ' .tep_date_long($ds['date_start']) ?>
<?php echo ' To: ' .tep_date_long($ds['date_stop']) ?>

Hmm, I don't have any ideas as to why that may be. I maintain a number of sites that use this contribution and none of them have such a problem, even my own. I canonly guess that it is due to how your server supplies the dates.

Edited by Jack_mcs

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 don't have any ideas as to why that may be. I maintain a number of sites that use this contribution and none of them have such a problem, even my own. I canonly guess that it is due to how your server supplies the dates.

Strangely, the module works very similar to Specials, there is no problem with dates ...

Link to comment
Share on other sites

I have a question, how to put limit for the duration of the campaign in the time (h, min, s)?

There's not an option for that.

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 don't have any ideas as to why that may be. I maintain a number of sites that use this contribution and none of them have such a problem, even my own. I canonly guess that it is due to how your server supplies the dates.

Hmm, My opinion is that with this query in includes/modules/daily_specials_banner.php

$ds_query = tep_db_query("select * from " . TABLE_DAILY_SPECIALS . " where date_start <= current_date() and date_stop >= current_date() and ( language_id = 99 or language_id = '" . (int)$languages_id . "') order by rand() limit 1");

script will also show the campaign ended on a current date because of "and date_stop >= current_date()". Corect will be "and date_stop > current_date()". Or am I wrong?

Link to comment
Share on other sites

  • 1 month later...

Hi guys,

 

Just updated the install from v1.3-v1.4-v1.5. No error codes! Yay. However there is something that has been bothering me for a while. Sometimes the daily specials banner doesnt appear on any webpages. You click on one page, it appears, you click on another and it doesnt. Any ideas as to why?

 

Oh and is there a way to edit the webpage you get sent to when you click on the banner?

 

Thanks for the support!

Link to comment
Share on other sites

Hi guys,

 

Just updated the install from v1.3-v1.4-v1.5. No error codes! Yay. However there is something that has been bothering me for a while. Sometimes the daily specials banner doesnt appear on any webpages. You click on one page, it appears, you click on another and it doesnt. Any ideas as to why?

 

Oh and is there a way to edit the webpage you get sent to when you click on the banner?

 

Thanks for the support!

If you have a special set to test mode, it will cause that missing banner. You need to be sure all of the stop dates are set to past dates for any banner you don't want to show.

 

The text in the popup is edited in the daily specials section in admin. If you want to edit the actual file, you will need to edit it as you would any file in 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

If you have a special set to test mode, it will cause that missing banner. You need to be sure all of the stop dates are set to past dates for any banner you don't want to show.

 

The text in the popup is edited in the daily specials section in admin. If you want to edit the actual file, you will need to edit it as you would any file in your shop.

 

 

Great thanks for that! With regards the popup window, what I meant was it would be good to have an option to change the popup page location. For example, as it is now, a popup page comes up with the daily special information. However, what I was referring to was having the popup page the actual product page which corresponded to the item that was on special for that day.

Link to comment
Share on other sites

Great thanks for that! With regards the popup window, what I meant was it would be good to have an option to change the popup page location. For example, as it is now, a popup page comes up with the daily special information. However, what I was referring to was having the popup page the actual product page which corresponded to the item that was on special for that day.

If you do that, the links in the popup will have a different sesion ID than the current ID. If the customer is logged in, they will be logged out in the popup. If they decide to order from the popup, it won't be in the cart in the main shop. It seems like a good idea but it would create a lot of problems.

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

  • 2 months later...

Hello,

I installed everything as described on my oscommerce 2.3.1.

ans after that, when I go on the site, I get this message:

( ! ) Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\Users\Alain\Documents\Weblocal\lejoaillier\includes\modules\boxes\bm_information.php on line 51.

This is the line 51: ' </div>' .

Here is the code I have in that file:

 

<?php
/*
 $Id$
 adapted for Information Pages Unlimited v2.05

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2010 osCommerce

 Released under the GNU General Public License
*/

 class bm_information {
   var $code = 'bm_information';
   var $group = 'boxes';
   var $title;
   var $description;
   var $sort_order;
   var $enabled = false;

   function bm_information() {
     $this->title = MODULE_BOXES_INFORMATION_TITLE;
     $this->description = MODULE_BOXES_INFORMATION_DESCRIPTION;

     if ( defined('MODULE_BOXES_INFORMATION_STATUS') ) {
       $this->sort_order = MODULE_BOXES_INFORMATION_SORT_ORDER;
       $this->enabled = (MODULE_BOXES_INFORMATION_STATUS == 'True');

       $this->group = ((MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
     }
   }

   function execute() {
     global $oscTemplate;

// BOF: Information Pages Unlimited
     require_once(DIR_WS_FUNCTIONS . 'information.php');
// EOF: Information Pages Unlimited

     $data = '<div class="ui-widget infoBoxContainer">' .
             '  <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_INFORMATION_BOX_TITLE . '</div>' .
             '  <div class="ui-widget-content infoBoxContents">' .
                  tep_information_show_category(1) .
//              '    <a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . MODULE_BOXES_INFORMATION_BOX_SHIPPING . '</a><br />' .
//              '    <a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . MODULE_BOXES_INFORMATION_BOX_PRIVACY . '</a><br />' .
//              '    <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . MODULE_BOXES_INFORMATION_BOX_CONDITIONS . '</a><br />' .
             '    <a href="' . tep_href_link(FILENAME_ABOUT_US) . '">' . MODULE_BOXES_INFORMATION_BOX_ABOUT_US . '</a><br />' .
	      '    <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . MODULE_BOXES_INFORMATION_BOX_CONTACT . '</a><br>' .
             '    <a href="' . tep_href_link(FILENAME_EASYMAP) . '">' . MODULE_BOXES_INFORMATION_EASYMAP . '</a>' 
             '  </div>' .
             '</div>';

     $oscTemplate->addBlock($data, $this->group);
   }

   function isEnabled() {
     return $this->enabled;
   }

   function check() {
     return defined('MODULE_BOXES_INFORMATION_STATUS');
   }

   function install() {
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Module', 'MODULE_BOXES_INFORMATION_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
     tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_INFORMATION_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
   }

   function remove() {
     tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
   }

   function keys() {
     return array('MODULE_BOXES_INFORMATION_STATUS', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'MODULE_BOXES_INFORMATION_SORT_ORDER');
   }
 }
?>

 

Thank you.

Edited by AlainBensimon
Link to comment
Share on other sites

As with most contributions, this one is not setup to work with 2.3. I might change that at some point. It just depends upon my time.

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 found what was not working.

In the file you put this:

 

3) In includes/modules/boxes/bm_information.php

 

REPLACE

 

' <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . MODULE_BOXES_INFORMATION_BOX_CONTACT . '</a>'

 

with

 

' <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . MODULE_BOXES_INFORMATION_BOX_CONTACT . '</a><br>' .

' <a href="' . tep_href_link(FILENAME_EASYMAP) . '">' . MODULE_BOXES_INFORMATION_EASYMAP . '</a>'

 

a dot is missing at the end of the last sentence.

Now it's working.

Link to comment
Share on other sites

I don't understand, in your files, you made a special folder fro version 2.3.

 

"If your shop is version 2.3 or later, use the oscommerce_2.3 directory."

No, I don't recall doing that. In fact, I just downloaded the last version, 1.5, of this contribution from here, http://addons.oscommerce.com/info/7142, and it doesn't have anything at all do to with 2.3 that I can see. Are you sure you are using this conribution?

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

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