Jump to content

Recommended Posts

Hi all,

I have collected some starting points for oscommerce addon developers/store owners

addon basic 1-3 steps
http://forums.oscommerce.com/topic/407530-addon-development-best-practices/page-7#entry1731163

price questions 4-5 steps:
http://forums.oscommerce.com/topic/408006-display-price-for-login-members-only/#entry1731360

 

@clustersolutions
@greasemonkey
@Dan Cole

@Tsimi
@burt

and the others

:thumbsup:

 

 


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

@@greasemonkey

 

My basic proposals for SPPC Aps

- build administation (hard work)

- login hook or login module
- logoff hook
- extends shopping_cart class in a boot loader module. (it could be a code append after the hook class later)
- extend currencies class for price displays in a boot loader module (it could be a code append after the hook class later)
- account info module for users

no need order total module or anything else.

Its aprox 7 little files on shop site ;)
 


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

@@Gergely that is awesome.  I had a look at what you and @clustersolutions did and that should simplify the work needed on the shop side of things.  I got a bit of a headache looking at it (classes have always given me a headache :wacko:) but I'm looking forward to the learning.  :thumbsup:   I guess in this case timing is everything.

 

@greasemonkey  Scott I know the plan is to rewrite the contribution but what version did you use as your starting point?  Just want to try and get up to speed and have a closer look at how the version you selected works.

 

Dan

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

sounds great
 
i have sppc already integrated but with normal code in the front and backend of several shops
 
will the future version of sppc have the same functionality as the last version of sppc
is is possible to extends this with the addons for sppc like qtpro for sppc or admin specials by categories for sppc

 
see images

 

greet

 

eric

 

category customer groups

post-197216-0-05147100-1437079970_thumb.jpg

 

products customer group

post-197216-0-62294400-1437079981_thumb.jpg

 

customergroups

post-197216-0-76139700-1437079992_thumb.jpg

 

customers

post-197216-0-48607800-1437080047_thumb.jpg

 

customer edit

post-197216-0-74555200-1437080001_thumb.jpg

 

 

Share this post


Link to post
Share on other sites

Hi all,

I have done a research for spp price display. There could be a solution with globals but 3 box class have to edit or pack into the contribution. They need $random_product as global variable.


I know that sppc has more complex price handling but I dont want to figure out totaly.

 

Here is one possible basic price redefination extended codebase example with global variable solutions:

  if (class_exists('currencies')) {
    class currencies_modspp extends currencies {
      public function display_price($products_price, $products_tax, $quantity = 1) {
        global $customer_id,
               $spp, 
               $product_info,
               $listing, 
               $new_products,
               $random_product;  //this should be global in bm_whats_new.php, bm_reviews.php, bm_special.php

        if (tep_session_is_registered('customer_id') && defined(MODULE_BOOTSTRAP_SPP_PRICE_DISPLAY_STATUS) && MODULE_BOOTSTRAP_SPP_PRICE_DISPLAY_STATUS == 'True') {

          if (isset($_SESSION['spp']) && $_SESSION['spp'] == 1) {

            $error = false;
            if ( isset($product_info['products_id']) && $product_info['products_id'] > 0 ) {
              //product_info!
              $products_id = $product_info['products_id'];
            } elseif ( isset($listing['products_id']) && $listing['products_id'] > 0 ) {
              //product listings
              $products_id = $listing['products_id'];
            } elseif ( isset($new_products['products_id']) && $new_products['products_id'] > 0 ) {
              //new product module
              $products_id = $new_products['products_id'];
            } elseif ( isset($random_product['products_id']) && $random_product['products_id'] > 0 ) {
              //TODO: modify 3 boxes use $random_product as global!
              $products_id = $random_product['products_id'];
            } else {
              $error = true;
            }

            if ($error === false) {
              $spp_price_query = tep_db_query("select spp_price from products where products_id = '" . (int)$products_id . "'");
              $products = tep_db_fetch_array($spp_price_query);

              $products_price = $products['spp_price'];  //without compromise
            }
          }
          return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
        } else {
          return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
        }
      }
    }
  }

spp_price added into products table and one session variable used from login if customer has sppc rights than used 1 if not than used 0.


Example of box code changes:

 

    function execute() {
      global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate;

to:

    function execute() {
      global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate, $random_product;

or we could add into modified boxes in the package.



I was not so lucky with shopping cart class, its possible we have to solve this with order total modules as burt suggested.


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

I've a feeling this might be a dumb question, but here goes anyway...

 

Where you've got

              $spp_price_query = tep_db_query("select spp_price from products where products_id = '" . (int)$products_id . "'");
              $products = tep_db_fetch_array($spp_price_query);

              $products_price = $products['spp_price'];  //without compromise

shouldn't that be a fetch from a separate price table keyed on products_id & customer_group (presumably derived from customer_id) or something like that? Isn't that the point of sppc?

 

Or is what you've put just a shorthand for the proper processing which you said didn't need figuring out yet?


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@@BrockleyJohn

 

Its only an example code. I have a similar price manager. I dont use sppc.


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Share this post


Link to post
Share on other sites

Hi all,


It would be better to use more diferential class functions. When special pricies or attributes rendering its cause logical price missings..
 

<?php echo '<del>' . $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br /><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; ?>

currencies class has only one standard way to display prices but the specials prices should be more differs.

When $1000 is displaying it would be better not to use $currencies->display_price() instead should use $currencies->display_deleted_price()
 

    function display_deleted_price($products_price, $products_tax, $quantity = 1) {
      return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
    }

    function display_attributes_price($products_price, $products_tax, $quantity = 1) {
      return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
    }

these little bit mods allow us to use different fine more accurate price handling somewhere in the core.

 

<?php echo '<del>' . $currencies->display_deleted_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</del><br /><span class="productSpecialPrice">' . $currencies->display_price($random_product['specials_new_products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) . '</span>'; ?>

I think that all SPPC theoretical required modifications could be figured out finaly.

modified classes:
- shopping_cart

extended class:
- currencies class

modified files
- bm_specials box
and all files where special or attributes prices displayed


:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

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

×