Jump to content
greasemonkey

SPPC - for 2.3.4

Recommended Posts

@@greasemonkey 

 

Scott just wanted to say thanks for your work on this.  I completed the install and it seems to be working very well.  I can see that you put a lot of work and effort into updating it and I wanted to say thanks for taking the time and making the effort.  Well done!

 

Dan

Share this post


Link to post
Share on other sites

@@Dan Cole no problem.

 

If you don't require all the features however, I would encourage you to try out @@raiwa version.

 

Dramatically less core code changes.

 

And I would also say probably better supported (let's face it.... I'm no coder....)

Share this post


Link to post
Share on other sites

@@greasemonkey

 

I thought about that but unfortunately I needed more than just one additional customer group.  In any case thanks again...

 

Dan

Share this post


Link to post
Share on other sites

If you don't need more than 1 additional price then use...@@raiwa 's version. His contribution can be found here.  If you need more then 1 additional price level, you have some serious work to do.

 

Dan

Share this post


Link to post
Share on other sites

i already started sppc. its easy but it need a new documentation.

 

i prefer it because it could be compatible with "quick update" addon and "specials by category" addon.

Share this post


Link to post
Share on other sites

i already started sppc. its easy but it need a new documentation.

 

i prefer it because it could be compatible with "quick update" addon and "specials by category" addon.

 

Hi Psytanium,

 

I'm having the same problem here. Plenty of SPPC for 2.3.3.4 modified files are substantially different when trying to apply changes to a stock 2.3.4 installation (e.g. loging.php etc.) Did you find a solution ? 

Share this post


Link to post
Share on other sites

Hi Psytanium,

 

I'm having the same problem here. Plenty of SPPC for 2.3.3.4 modified files are substantially different when trying to apply changes to a stock 2.3.4 installation (e.g. loging.php etc.) Did you find a solution ?

 

Hello @@dp.ramone,

 

If you do not need more than one wholesaler group, give this a try: here.

Ther is a version for 2.3.4 standard included

Edited by raiwa

Share this post


Link to post
Share on other sites

Thanks for the tip, but I do need more than one wholesaler group. I meanwhile got everything to work. Cheers!

Share this post


Link to post
Share on other sites

I'm running the greasemonkey version of SPPC with the BOOTSTRAP - SPPC 2.3.4 BS GOLD - v1.1b release. I'm doing a bulk price update of 5% across the board. For updating my pricing for my standard retail price, this is easy... just a quick db query of:

update products set products_price=products_price * 1.05

However, for updating my pricing for all my customer groups (I have 6) I'm a little bewildered as to what to update!

I have three tables here:

products_group_prices_cg_1
products_group_prices_cg_2
products_groups
 
All of them SEEM to have pricing info in them. I have no idea what needs to be updated tho. I'm unsure if the cg_ tables are still in use, to be honest. It might just be a holdover from prior work... but I have to say after grepping through the code I am still seeing references to the cg tables. The products_groups table SEEMS like it's the table I need to update:
select * from products_groups order by products_id limit 12;
+--------------------+-----------------------+-------------+
| customers_group_id | customers_group_price | products_id |
+--------------------+-----------------------+-------------+
|                  1 |             2058.0000 |          39 |
|                  2 |             1958.0000 |          39 |
|                  3 |             1858.0000 |          39 |
|                  4 |             1850.0000 |          39 |
|                  5 |             1900.0000 |          39 |
|                  6 |             1921.0000 |          39 |
|                  1 |             1675.5000 |          40 |
|                  2 |             2000.5000 |          40 |
|                  3 |             1950.5000 |          40 |
|                  4 |             1900.5000 |          40 |
|                  5 |             1850.5000 |          40 |
|                  6 |             1564.0000 |          40 |
I THINK I would just need to do a similar update of products_groups of:
update products_groups set customers_group_price = customers_group_price * 1.05; 
but, I'm TOTALLY not clear on what to make of, or what to do with, those mystifying products_group_prices_cg_1 and products_group_prices_cg_2 tables???

Share this post


Link to post
Share on other sites

I don't use Scott's update but I have those extra tables and they seem to be for recording any "special" prices that you might set.  I would update just one product in the product groups table and then look around and see if it seems to work as you expect.  I would also add a "special" just to confirm the purpose of those other tables.   I'm a cautious guy.

 

Dan 

Share this post


Link to post
Share on other sites

@@mattsc

 

 

The products_groups table SEEMS like it's the table I need to update:

 

That is the one.... each product_id in your store will be associated with a customers_group_id

 

To over simplify....

 

Product id 1 group id 1 = customers_group_price $1.00

product id 2 group id 1 = customers_group_price $2.00

 

product id 1 group id 2 = customers_group_price $0.99

product id 2 group id 2 = customers_group_price $1.99

 

Make sense?

Share this post


Link to post
Share on other sites

@@mattsc

 

 

That is the one.... each product_id in your store will be associated with a customers_group_id

 

To over simplify....

 

Product id 1 group id 1 = customers_group_price $1.00

product id 2 group id 1 = customers_group_price $2.00

 

product id 1 group id 2 = customers_group_price $0.99

product id 2 group id 2 = customers_group_price $1.99

 

Make sense?

 

Mostly. I still don't know what to ake of the _cg_1 and _cg_2 tables. The products_groups table is straight forward enough... I just can't quite figure out the interaction(s) with the other two tables of pricing mystery. :)

Share this post


Link to post
Share on other sites

hi, I've just installed SPPC 2.3.4 BS GOLD - v1.1b on a fresh install of osc... 

Ive noticed that when I go to edit a group in customer groups it drops the id number and displays the primary group instead;

eg ... /catalog/admin/customers_groups.php?page=1&cID=&action=edit

I can manually put the id number after the cID= bit in the above URL and still access it, but obviously would prefer to not have to.

Is this a common problem? I cant find any reference to it anywhere and as it is a fresh install and first app added I am wondering if I have done something wrong with the initial install.

Share this post


Link to post
Share on other sites

Hello,

I have been using the original SPPC add on for a long time in my shopping cart,

However, now that I'm trying to move to Bootstrap Edge, It seems really difficult to implement it, since I don't want to lose my original shopping cart data.

The latest version I could find is the BOOTSTRAP - SPPC 2.3.4 BS GOLD - v1.1b (not for edge) and I have run into some problems with the implementation.

I can see how     

reset($this->contents);
while (list($products_id, ) = each($this->contents)) {

become

foreach(array_keys($this->contents) as $products_id) {

So I left those alone.

However how to implement this (I assume) older code

       reset($this->contents[$products_id]['attributes']);
       $where = " AND ((";
        while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
         $where .= "options_id = '" . (int)$option . "' AND options_values_id = '" . (int)$value . "') OR (";
       }
       $where=substr($where, 0, -5) . ')';
    
       $attribute_price_query = tep_db_query("SELECT products_attributes_id, options_values_price, price_prefix FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . (int)$products_id . "'" . $where ."");

into this:

foreach($this->contents[$products_id]['attributes'] as $option => $value) {
            $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");

with those extra $where = statements baffle me.

Can someone help please.

Thank you,

Thadson

Share this post


Link to post
Share on other sites

@greasemonkey
@Dan Cole
hi

I have 234.1 Edge (BS) with SPPC addons.
in admin/catagories/special
i can view and edit the special lists, but when i try to insert the new specials, i got this error:

Product:  1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

select customers_group_price, customers_group_id from products_groups where products_id =

and this is the code related in admin/special.php

 $price_query = tep_db_query("select customers_group_price from products_groups WHERE products_id = ".(int)$products_id . " AND customers_group_id  = ".(int)$customers_group);

and this is related SQL

DROP TABLE IF EXISTS products_groups;
CREATE TABLE `products_groups` (
  `customers_group_id` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
  `customers_group_price` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `products_id` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

the error mentioned the MySQL version error, but dont know what how to write the right version for the ENGINE=.... part, can someone please help?

Thanks! Lyn

Share this post


Link to post
Share on other sites
10 hours ago, ce7 said:

$price_query = tep_db_query("select customers_group_price from products_groups WHERE products_id = ".(int)$products_id . " AND customers_group_id  = ".(int)$customers_group);

This query isn't right but it has me wondering where it came from...I can't image that it was in the add-on.  It should probably be something like...

$price_query = tep_db_query("select customers_group_price from products_groups WHERE products_id = ' " . (int)$products_id . " ' AND customers_group_id  = ' ". (int)$customers_group . " ' ");

Dan

Share this post


Link to post
Share on other sites

@ce7 the query you mentioned above is not the query that is used for adding "new" specials.... This would be the query you are looking for/at

// BOF Separate Pricing Per Customer
    tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status, customers_group_id) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1', ".(int)$customers_group.")");
// EOF Separate Pricing Per Customer

There are a number of significant changes to admin/specials.php... if you haven't already, use a comparison tool WinMerge to compare your file to the file include with the download.

 

 

Share this post


Link to post
Share on other sites
On 9/21/2018 at 11:18 PM, Dan Cole said:

This query isn't right but it has me wondering where it came from...I can't image that it was in the add-on.  It should probably be something like...

$price_query = tep_db_query("select customers_group_price from products_groups WHERE products_id = ' " . (int)$products_id . " ' AND customers_group_id  = ' ". (int)$customers_group . " ' ");

Dan

hi @Dan Cole

@greasemonkey

Thank you for reply.
I downloaded from addons.oscommerce.com/info/0716 (20151005) BOOTSTRAP - SPPC 2.3.4 BS GOLD - v1.1b version.

it said:

Line 33 [41 in edited file]
**AFTER**
add the mentioned code.


I am not programmer, know a bit only SQL so no idea how to fix this....just follow the installation instruction... I know it is not a good idea to mix the addons in different version, but few 2.2 version still working perfect with 234.1Edge (BS), so I gave this a try, not sure if the complete add one working or not, but with the admin, assign customer group or attribute group, it seems working, admin/specials.php is the only file so far have the error message.... 

Thanks! Lyn

Share this post


Link to post
Share on other sites

the file with

 customers_group_price, customers_group_id 

is actually @ admin/includes/functions/general.php

Find:

    $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name");
    while ($products = tep_db_fetch_array($products_query)) {
      if (!in_array($products['products_id'], $exclude)) {
        $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>';
      }
    } 

Replaced with:

      //BOF 0716 Separate Pricing Per Customer
      if (!in_array($products['products_id'], $exclude)) {
         $price_query=tep_db_query("select customers_group_price, customers_group_id from products_groups where products_id = " . $products['products_id']);
         $product_prices=array();
         while($prices_array=tep_db_fetch_array($price_query)){
             $product_prices[$prices_array['customers_group_id']]=$prices_array['customers_group_price'];
         }
         reset($all_groups);
         $price_string="";
         $sde=0;
         while(list($sdek,$sdev)=each($all_groups)){
             if (!in_array((int)$products['products_id'].":".(int)$sdek, $exclude)) {
                 if($sde)
                    $price_string.=", ";
                 $price_string.=$sdev.": ".$currencies->format(isset($product_prices[$sdek]) ? $product_prices[$sdek]:$products['products_price']);
                 $sde=1;
             }
         }
         $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $price_string . ')</option>\n';
      }
      // EOF     Separate Pricing Per Customer
      } // end while ($products = tep_db_fetch_array($products_query))
      //EOF 0716 Separate Pricing Per Customer 

I tried to use unmodified specials.php but it is showing up the same error, and go back to check on the installation and found out the code is  modified @ general.php, not sure how to fix it in order to get rid of this 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

select customers_group_price, customers_group_id from products_groups where products_id =

 

Share this post


Link to post
Share on other sites
3 hours ago, ce7 said:

I downloaded from addons.oscommerce.com/info/0716 (20151005) BOOTSTRAP - SPPC 2.3.4 BS GOLD - v1.1b version.

Hello Lyn,

This version is already very outdated. It was updated from the old version for 2.3.4. BS Gold and may have more issues to wget it working weell with the latest EDGE versions and PHP 7.

I know that you spent already time in the installation, but if you do not need more than one wholesale group, it might be worth to start over with my Wholesale (SPPC) light add-on which is complete new coded, up to date for latest EDGE and CE Frozen and much easier and less job to install.

https://apps.oscommerce.com/VWUpG&wholesale-sppc-lite

Share this post


Link to post
Share on other sites
5 hours ago, raiwa said:

Hello Lyn,

This version is already very outdated. It was updated from the old version for 2.3.4. BS Gold and may have more issues to wget it working weell with the latest EDGE versions and PHP 7.

I know that you spent already time in the installation, but if you do not need more than one wholesale group, it might be worth to start over with my Wholesale (SPPC) light add-on which is complete new coded, up to date for latest EDGE and CE Frozen and much easier and less job to install.

https://apps.oscommerce.com/VWUpG&wholesale-sppc-lite

hi 🧚‍♂️ @raiwa

I do put both at the same time! 😅
I will try to uninstall the Gold version now. Thank you so much for always give the great support!!! 👍

 

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

×