tgely Posted July 11, 2015 Share Posted July 11, 2015 Hi all,I have collected some starting points for oscommerce addon developers/store ownersaddon basic 1-3 stepshttp://www.oscommerce.com/forums/topic/407530-addon-development-best-practices/page-7#entry1731163 price questions 4-5 steps:http://www.oscommerce.com/forums/topic/408006-display-price-for-login-members-only/#entry1731360 @clustersolutions@greasemonkey@Dan Cole @Tsimi@burtand the others :thumbsup: 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. Link to comment Share on other sites More sharing options...
greasemonkey Posted July 11, 2015 Share Posted July 11, 2015 Thank you kindly @@Gergely. This will be a good place to start a development thread. (So we don't clog up other general threads with specifics). Link to comment Share on other sites More sharing options...
tgely Posted July 11, 2015 Author Share Posted July 11, 2015 @@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 ;) 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. Link to comment Share on other sites More sharing options...
Dan Cole Posted July 12, 2015 Share Posted July 12, 2015 @@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 Need help? See this thread and provide the information requested. Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix) here. Link to comment Share on other sites More sharing options...
clustersolutions Posted July 12, 2015 Share Posted July 12, 2015 Awesome!!! On member approval for now... Link to comment Share on other sites More sharing options...
ocs1409 Posted July 16, 2015 Share Posted July 16, 2015 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 sppcis 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 products customer group customergroups customers customer edit Link to comment Share on other sites More sharing options...
tgely Posted July 19, 2015 Author Share Posted July 19, 2015 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. 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. Link to comment Share on other sites More sharing options...
BrockleyJohn Posted July 20, 2015 Share Posted July 20, 2015 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? Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released. Looking for a payment or shipping module? Maybe I've already done it. Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x Link to comment Share on other sites More sharing options...
tgely Posted July 20, 2015 Author Share Posted July 20, 2015 @@BrockleyJohn Its only an example code. I have a similar price manager. I dont use sppc. 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. Link to comment Share on other sites More sharing options...
tgely Posted July 30, 2015 Author Share Posted July 30, 2015 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_cartextended class:- currencies classmodified files- bm_specials boxand all files where special or attributes prices displayed 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.