Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

Hello Scott @@greasemonkey

 

I have OSC 2.3.4 BS EDGE up and running in development. I have completed installing SPPC (Separate Pricing Per Customer), thanks for your contributional upload. I also have installed SEO Header Tags Reloaded.

 

For me it was easier to have two separate development stores of BS, one for SPPC and one for SEO-HTR. Then when both contributions were completed I migrated and merged SEO-HTR with the SPPC development site. However, not necessary, it did help me to have 2 development sites.

 

Now for some observations and questions.

 

First, I did not find /catalog/admin/specials.php in your contribution. In fact the last time it had been included in any contribution upload was back in 8 Mar 2011 by JohnAtYM. I never realized this, but now this answers why my specials in another development site did not work.

 

Now specials work with SPPC.

 

Second, I believe that the SPPC modification in /catalog/includes/funtions/database.php is only necessary for certain hosting server problems. When I installed this modification, it breaks my store. Without it, I seem to be ok. Any thoughts on this would be appreciated. In the upload contribution just before yours, 2.3.3.4, this modification for database.php is left out.

 

Third, it appears that in /catalog/product_info.php there maybe a coding error, but since I am not a coder, just a cut and paster, I can't say for sure. On line 65; you have </s> but I think it should be </del>

 

I will continue my testing and again thanks greatly Scott. :thumbsup: Because SPPC is such an important contribution, being able to use it for my store renews my confidence in the future of OSC. It's that important. Also, thanks to the whole OSCommerce team and community.

 

Alan :)


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

@@spiritalan thank you for your feedback. An important note (warning) - I'm not a coder either. I have however learned enough around here to be dangerous (or helpful... depending on your view) and I contribute where and when I can.

 

 

First, I did not find /catalog/admin/specials.php in your contribution. In fact the last time it had been included in any contribution upload was back in 8 Mar 2011 by JohnAtYM. I never realized this, but now this answers why my specials in another development site did not work.

 

Yes, it looks like I've missed the admin/specials.php file. I will add it to the next update.

 

 

Second, I believe that the SPPC modification in /catalog/includes/funtions/database.php is only necessary for certain hosting server problems. When I installed this modification, it breaks my store. Without it, I seem to be ok. Any thoughts on this would be appreciated. In the upload contribution just before yours, 2.3.3.4, this modification for database.php is left out.

Please see here; http://forums.oscommerce.com/index.php?showtopic=53436&view=findpost&p=563454

 

Are you in a similar position? There are 3 functions added... can you confirm which of the 3 breaks the store and with what error? We will hopefully draw on someone with more coding experience to help fix this....

 

Also, as a test, if you have manually edited your file - please rename to something else and try dropping my file in its place.

 

 

Third, it appears that in /catalog/product_info.php there maybe a coding error, but since I am not a coder, just a cut and paster, I can't say for sure. On line 65; you have </s> but I think it should be </del>

yes you are correct.... i will fix this in the next update.

Edited by greasemonkey

Share this post


Link to post
Share on other sites

Scott,

When I drop in your file, includes/function/database.php, it breaks the store. I will do some testing, maybe comment out one function at a time.

Alan


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

Scott,

 

I don't know what admin/functions/database.php file is for and I can't find by commenting out functions what's causing the mod to break the store so maybe it is something else within my changes in other files.

 

I am now checking my files against yours. This is something I have not done except only with about 10 files; many of the ones I could not copy and paste within the code of each file. Let's see how this goes.

 

My first file I find different than yours is admin/includes/functions/general.php. The following code is missing in yours. I believe this is for attributes. I don't use attributes for my store, but it appears my attributes is working for group pricing. It is pasted before the last ?> in file.

// Separate Price Per Customer
function tep_get_hide_info($customers_groups, $attributes_hide_from_groups) {
  $hide_attr_from_groups_array = explode(',', $attributes_hide_from_groups);
  $hide_attr_from_groups_array = array_slice($hide_attr_from_groups_array, 1); // remove "@" from the array
  $attribute_hidden_from_string = '';
	$hide_info = '';
	if (LAYOUT_HIDE_FROM == '1') {
	      for ($i = 0; $i < count($customers_groups); $i++) {
		      if (in_array($customers_groups[$i]['customers_group_id'], $hide_attr_from_groups_array)) {
	        $attribute_hidden_from_string .= $customers_groups[$i]['customers_group_name'] . ', '; 
		      }
              } // end for ($i = 0; $i < count($customers_groups); $i++)
	      $attribute_hidden_from_string = rtrim($attribute_hidden_from_string); // remove space on the right
	      $attribute_hidden_from_string = substr($attribute_hidden_from_string,0,strlen($attribute_hidden_from_string) -1); // remove last comma
	      if (!tep_not_null($attribute_hidden_from_string)) { 
	      $attribute_hidden_from_string = TEXT_GROUPS_NONE; 
	      }
	      $attribute_hidden_from_string = TEXT_HIDDEN_FROM_GROUPS . $attribute_hidden_from_string;
				// if the string in the database field is @, everything will work fine, however tep_not_null
				// will not discover the associative array is empty therefore the second check on the value
	if (tep_not_null($hide_attr_from_groups_array) && tep_not_null($hide_attr_from_groups_array[0])) {
		  $hide_info = tep_image(DIR_WS_ICONS . 'tick_black.gif', $attribute_hidden_from_string, 20, 16);
		} else {
		  $hide_info = tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $attribute_hidden_from_string, 20, 16);
	  }
	} else {
		// default layout: icons for all groups
      for ($i = 0; $i < count($customers_groups); $i++) {
        if (in_array($customers_groups[$i]['customers_group_id'], $hide_attr_from_groups_array)) {
          $hide_info .= tep_image(DIR_WS_ICONS . 'icon_tick.gif', $customers_groups[$i]['customers_group_name'], 11, 11) . '  ';
        } else {
          $hide_info .= tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', 11, 11) . '  ';
        }
      }
	}
	return $hide_info;
}
// End of Separate Price Per Customer

Alan :)


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

Scott,

I will try and give you as much information as I can which I hope will help you in your contribution cut and paste development. Most of what I copy and pasted is from the latest SPPC contribution just before yours.

 

The following code might be significant. I found it in my file admin/includes/languages/english.php but not in yours.

// BOF Separate Pricing Per Customer
define('IMAGE_GROUP_PRICES', 'Group Prices');
define('IMAGE_NEW_GROUP', 'New Customer Group');
// EOF Separate Pricing Per Customer

Alan :)


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

Scott,

See my post above: http://forums.oscommerce.com/topic/53436-seperate-pricing-per-customer-v35/?p=1728491

 

I found the problem this time on about line 808. This needs correcting in your contribution file admin/customer_groups.php.

 

Also, a few lines of code before this problem, 796-798, have a lot of extra spaces after the lines of code.

 

Alan :)


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

Scott,

 

I found the reason why the code for SPPC in includes/functions/database.php was breaking my front end of store. The code was moved to includes/functions/general.php. I am using the contribution from 4 Jan 2014.

 Alan :)


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

@@spiritalan ok, I've taken your notes and updated the package... Just a note, there are several errors includes/functions/general.php in the 2.3.3.4 file you are working with.... Give the new ones a try. Here is the changelog;

 

 

June 29th 2015 by greasemonkey - version 1.1a

 Added admin/specials.php to file set previously missing
 Fix </s> in catalog/product_info.php - should have been </del>
 Moved includes/functions/database.php changes to general
 Fixed admin/product_attributes.php and moved function to admin/includes/functions/general.php
 Added new defines to admin/includes/languages/english.php for product_attributes.php

http://addons.oscommerce.com/info/716

Share this post


Link to post
Share on other sites

Thanks, Scott.

I'll check out includes/functions/general.php.

 

Alan


Production:
osCommerce V. 2.3.4BS
VPS Box

Share this post


Link to post
Share on other sites

@revamp @spiritalan :arrow_up_small: :arrow_up_small: :arrow_up_small: :arrow_up_small: :arrow_up_small: :arrow_up_small: :arrow_up_small: :arrow_up_small: :arrow_up_small: :arrow_up_small:  see above....

 Hello Scott,

 

Many thanks for this contribution!

Share this post


Link to post
Share on other sites

I don't know why tax is not included. using 2.3.4BT

 

the Configuration, My Store, Display prices with taxes is True

Retail is set to Show prices with taxes

When I logout, the price show with taxes

I checked the tax zone, all countries

 

I noticed when I remove this code from includes/functions/general.php the tax is included.

 

 if (!isset($_SESSION['sppc_customer_group_tax_exempt'])) {
       $customer_group_tax_exempt = '0';
     } else {
       $customer_group_tax_exempt = $_SESSION['sppc_customer_group_tax_exempt'];
     }

 

Any idea please ?

Share this post


Link to post
Share on other sites

I'm using this query, and i get a duplicate special product.

$listing_sql .= "p.products_id,
                   p.products_model,
				   p.fr_currencies_id,
                   p.manufacturers_id,
                   m.manufacturers_name,
                   p.products_price,
                   p.products_tax_class_id,
                   IF(s.status, s.specials_new_products_price, NULL)
                     as specials_new_products_price,
                   IF(s.status, s.specials_new_products_price, p.products_price)
                     as final_price
                 from
                   " . TABLE_PRODUCTS . " p
                 left join " . TABLE_SPECIALS . " s
                   on p.products_id = s.products_id
                 left join " . TABLE_MANUFACTURERS . " m
                   on p.manufacturers_id = m.manufacturers_id
                 join " . TABLE_PRODUCTS_DESCRIPTION . " pd
                   on p.products_id = pd.products_id
                 join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
                   on p.products_id = p2c.products_id
                   " . $sql_array['from'] . "
                 where
                   p.products_status = '1'
                   and pd.language_id = '" . (int) $languages_id . "'
                   " . $sql_array['where'] . "
                ";

anyway to remove the duplicate ?

Share this post


Link to post
Share on other sites

I managed to make this addon work allover my website, but i'm helpless with 1 file (whats new slider). I really appreciate some help here.

<?php
$products_newproducts_query = tep_db_query("select distinct pd.products_id, pd.products_name, pd.products_description, p.products_date_added, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_available, p.fr_currencies_id from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name limit ".MAX_RANDOM_SELECT_NEW."");
if (tep_db_num_rows($products_newproducts_query) > 0) {
?>



<div class="container main_product_slider slider_newproducts">
    <h2><?php echo MENU_TEXT_NEW_PRODUCTS; ?></h2>
    <div class="carousel es-carousel-wrapper style0">
        <div class="es-carousel">
            <div class="row">
                <div class="product_outer">

                    <!-- products output cycle -->
                    <?php
                    while ($newproducts = tep_db_fetch_array($products_newproducts_query)) {

                        $newproducts['specials_new_products_price'] = tep_get_products_special_price($newproducts['products_id']);
                        if (tep_not_null($newproducts['specials_new_products_price'])) {
                            $newproducts_price = '<span class="old">' . $currencies->display_price($newproducts['products_price'], tep_get_tax_rate($newproducts['products_tax_class_id']), $newproducts['fr_currencies_id']) . '</span><span class="new">' .$currencies->display_price($newproducts['specials_new_products_price'], tep_get_tax_rate($newproducts['products_tax_class_id']), $newproducts['fr_currencies_id']).'</span>';
                            $sticker_sale = STICKER_SALE;
                        } else {
                            $newproducts_price = $currencies->display_price($newproducts['products_price'], tep_get_tax_rate($newproducts['products_tax_class_id']), $newproducts['fr_currencies_id']);
                            $sticker_sale = '';
                        }


                        $newproducts_price = '<div class="product-price">'.$newproducts_price.'</div>';

                        $realpath = DIR_FS_CATALOG.'/images/'. $newproducts['products_image'];

                        /* if product has options */
                        $current_product =  $newproducts['products_id'];
                        $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$current_product . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
                        $products_attributes = tep_db_fetch_array($products_attributes_query);
                        if ($products_attributes['total'] > 0) {
                            $sticker_options = STICKER_OPTION;
                        }  else {
                            $sticker_options = '';
                        }
                        $rating	= rating_output($current_product);
                        /* if product has options */

                        /* if product has big img */
                        $products_new_added_big_img_query = tep_db_query("select distinct pi.image, pi.products_id from " . TABLE_PRODUCTS_IMAGES . " pi where pi.products_id = '$current_product' order by pi.id ASC ");
                        /* if product has big img */

                        $product_date = $newproducts['products_date_available'];

                        if (tep_not_null($product_date) && $product_date >= DAYS_QTY) {
                            $sticker_new = STICKER_NEW;
                        } else {
                            $sticker_new = '';
                        }
                        ?>
                        <!-- original product view -->
                        <div class="span3 product">


                            <div class="product-image-wrapper">

                                <!-- stickers -->
                                <?php echo $sticker_sale.$sticker_options.$sticker_new; ?>
                                <!-- stickers -->


                                <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $newproducts["products_id"]) ;?>">
                                    <?php
                                    if(file_exists($realpath)) {
                                        echo tep_image(DIR_WS_IMAGES . $newproducts['products_image'], $newproducts['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
                                    } else { ?>
                                        <img src="<?php echo DC_IMAGES.'empty.gif'; ?>" alt="">
                                    <?php } ?>

                                </a>
                            </div>
                            <div class="wrapper-hover">
                                <div class="product-name">
                                    <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $newproducts["products_id"]) ;?>">
                                        <?php echo trimmed_text($newproducts['products_name'] , 50) ?>
                                    </a>
                                </div>
                                <div class="wrapper">
                                    <?php echo $newproducts_price; ?>
                                    <div class="product-tocart">
                                        <a href="<?php echo tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $newproducts['products_id']) ?>"><i class="icon-basket"></i></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!-- original product view -->

                        <!-- rollover product view -->
                        <div class="preview hidden-tablet hidden-phone">
                            <div class="wrapper">
                                    <!-- product has some previews -->
                                    <?php
                                    if (ROLLOVER_EFFECT !== 'simple') {

                                        if (tep_db_num_rows($products_new_added_big_img_query) > 1) { ?>
                                            <div class="col-1">
                                                <!--  previews output -->
                                                <!-- stickers -->
                                                <?php echo $sticker_sale.$sticker_options.$sticker_new; ?>
                                                <!-- stickers -->

                                                <?php while ($products_new_added_big_img = tep_db_fetch_array($products_new_added_big_img_query)) { ?>
                                                    <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $newproducts["products_id"]) ;?>" class="image" data-rel="<?php echo tep_href_link(DIR_WS_IMAGES . $products_new_added_big_img['image'], $products_new_added_big_img['products_name']); ?>">
                                                        <?php echo tep_image(DIR_WS_IMAGES . $products_new_added_big_img['image'], $products_new_added_big_img['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class="thumb"'); ?>
                                                    </a>
                                                <?php } ?>
                                                <!--  previews output -->
                                            </div>
                                    <?php }
                                    }
                                    ?>
                                    <!-- product has some previews -->
                                     <?php
                                        $products_new_added_big_img_query1 = tep_db_query("select distinct pi.image, pi.products_id from " . TABLE_PRODUCTS_IMAGES . " pi where pi.products_id = '$current_product' order by pi.id ASC ");
                                        $products_new_added_big_img = tep_db_fetch_array($products_new_added_big_img_query1);
                                    ?>
                                    <!-- stickers -->
                                <?php echo $sticker_sale.$sticker_options.$sticker_new; ?>
                                <!-- stickers -->

                                    <div class="col-2">
                                        <div class="big_image">
                                            <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $newproducts["products_id"]) ;?>">
                                                <?php
                                                    if (tep_db_num_rows($products_new_added_big_img_query) > 0) {
                                                        echo tep_image(DIR_WS_IMAGES . $products_new_added_big_img['image'], $products_new_added_big_img['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
                                                    } else {
                                                        echo tep_image(DIR_WS_IMAGES . $newproducts['products_image'], $newproducts['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
                                                    }
                                                ?>
                                            </a>
                                        </div>
                                        <div class="wrapper-hover">
                                            <div class="product-name">
                                                <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $newproducts["products_id"]) ;?>">
                                                    <?php echo trimmed_text($newproducts['products_name'] , 50) ?>
                                                </a>
                                            </div>
                                            <div class="wrapper">
                                                <?php echo $newproducts_price; ?>
                                                <div class="product-tocart">
                                                    <a href="<?php echo tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $newproducts['products_id']) ?>"><i class="icon-basket"></i></a>
                                                </div>
                                            </div>

                                            <?php echo $rating; ?>
                                        </div>
                                    </div>


                            </div>
                        </div>
                        <!-- rollover product view -->


                    <?php } ?>
                    <!-- products output cycle -->

                </div>
            </div>
        </div>
    </div>
</div>



<?php
}
?>

Edited by Psytanium

Share this post


Link to post
Share on other sites

i solved my previous problems, i was trying to combine this addon with product specifications, friendly currency and quick price update... in case someone have problems with this combination.

Share this post


Link to post
Share on other sites

Hello Scot,

 

I have installed a clean osc 2.3.4 BS GOLD and when I drop your files from SPPC V1.1.a on top of it the front end breaks up: only a white page shows up.

 

I have read the notices from Alan, tried to leave out the catalog/includes/functions/general.php but no result.

 

When I drop the files in a osc 2.3.4 BS Edge the same thing happens.

 

Any idea?

Share this post


Link to post
Share on other sites

I have put in the files of SPPC V1.1A one by one in a clean OSC 2.3.4 BS GOLD: the problem of breaking up the front end seems to be in catalog/includes/classes/shopping_cart.php: I havo not yet figured it out why...

 

 

Solved one issue with create_account.php:

(SPPC says $_POST, should be $HTTP_POST_VARS)

POST[company_tax_id] should be $HTTP_POST_VARS['entry_company_tax_id'] 

and a few div issues at 413:

34:
//    if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
// BOF Separate Pricing Per Customer, added: field for tax id number
    if (ACCOUNT_COMPANY == 'true') { 
    $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
    $company_tax_id = tep_db_prepare_input($HTTP_POST_VARS['entry_company_tax_id']);
    }
// EOF Separate Pricing Per Customer, added: field for tax id number

413:
<!-- BOF Separate Pricing Per Customer: field for tax id number -->
      </div>
    </div>
    <div class="form-group">
      <label for="inputCompany" class="control-label col-sm-3"><?php echo ENTRY_COMPANY_TAX_ID; ?></label>
      <div class="col-sm-9">
		<?php
        echo tep_draw_input_field('entry_company_tax_id', NULL, 'id="inputCompany" placeholder="' . ENTRY_COMPANY_TAX_ID . '"');
        if (tep_not_null(ENTRY_COMPANY_TAX_ID_TEXT)) echo '<span class="help-block">' . ENTRY_COMPANY_TAX_ID_TEXT . '</span>';
        ?>
      </div>
    </div>
		
<!-- EOF Separate Pricing Per Customer: field for tax id number -->

Now the account_edit.php won't work, I will try to sort that out too.

Share this post


Link to post
Share on other sites

When I use the old catalog/includes/classes/shopping_cart.php from the SPPC 2.3.3.4 revised, everything works!

I didn't find the failure yet...

 

It seems that the files of SPPC V1.1A are mixed up someway.

Share this post


Link to post
Share on other sites

probably i found a problem in the file admin/customers_group.php , you must replace

$contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_CUSTOMERS_GROUPS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_group_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_CUSTOMERS_GROUPS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->categories_group_id . '&action=confirm')));

with:

$contents[] = array('align' => 'center', 'text' => tep_draw_button(IMAGE_EDIT, 'document', tep_href_link(FILENAME_CUSTOMERS_GROUPS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_group_id . '&action=edit')) . tep_draw_button(IMAGE_DELETE, 'trash', tep_href_link(FILENAME_CUSTOMERS_GROUPS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_group_id . '&action=confirm')));

or else i'm not able to delete a customer group. let me know if i'm going wrong. thx

Share this post


Link to post
Share on other sites

I'm running into an issue with SPPC and the tep_db_check_age_specials_retail_table function. When a special is created, on the first time the category that product exists in is is visited it generates a 1062 Duplicate Entry SQL error.

 

1062 - Duplicate entry '1600' for key 'PRIMARY'

insert into specials_retail_prices select s.products_id, s.specials_new_products_price, s.status, s.customers_group_id from specials s where s.customers_group_id = '0'

 

 

It's being caused by the "query2" query in the tep_db_check_age_specials_retail_table() function below:

    if (!$table_srp_exists || ($last_update_table_specials > $last_update_table_srp)) {
      if ($table_srp_exists) {
        $query1 = "truncate " . TABLE_SPECIALS_RETAIL_PRICES . "";
        if (tep_db_query($query1)) {
          $query2 = "insert into " . TABLE_SPECIALS_RETAIL_PRICES .
            " select s.products_id, s.specials_new_products_price, s.status, s.customers_group_id from " .
            TABLE_SPECIALS . " s where s.customers_group_id = '0'";
          $result = tep_db_query($query2);
        }

I thought it might be that the query1 truncate syntax might have needed the "table" added to it for a possible mysql syntax change, but changing it from truncate to truncate table didn't help.

 

Looking in the database directly, I can see an entry with a products_id of 1600, with a $0 amount in specials_new_products_price, but that's not coming from me when I create the special, and the products I'm creating specials for don't have product_id=1600 either. I've grep'd the code and can't find anything with a 1600 in it, so I've no clue where that value is coming from either.

 
I'm at a loss here. I can't figure out why it's only occurring on the first visit to the page, why it's happening in the first place, or how to fix it.
Edited by mattsc

Share this post


Link to post
Share on other sites

 

I'm running into an issue with SPPC and the tep_db_check_age_specials_retail_table function. When a special is created, on the first time the category that product exists in is is visited it generates a 1062 Duplicate Entry SQL error.

 

1062 - Duplicate entry '1600' for key 'PRIMARY'

 

insert into specials_retail_prices select s.products_id, s.specials_new_products_price, s.status, s.customers_group_id from specials s where s.customers_group_id = '0'

 

 

Found the problem. Somehow I ended up with a duplicate product_id in my specials table. I wiped the specials table, and now when adding specials I don't have a duplicate anymore, so it's resolved now.

Share this post


Link to post
Share on other sites

I am running OSCommerce 2.3.4 as a joomla Component (jcommerce), so It is NOT the Bootstrap edition.

Is there a version of SPPC that will work for stock 2.3.4 not bootstrapped?

I had this mod on my old 2.2rc2 shop and I really don't want to live without it

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×