Page 1 of 17 12311 ... LastLast
Results 1 to 10 of 163
  1. #1
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,689
    Plugin Contributions
    22

    Idea or Suggestion Twitch Wholesale with Twitch Wholesale Attributes

    Twitch Wholesale with Twitch Wholesale Attributes
    for ZenCart v1.51 - Version 13a
    October 13.2013

    This module will provide you with:
    - guest/retail/wholesale login and independent landing/index pages for each
    - wholesale filters for product pricing, attribute pricing and display purposes
    - base price, list price, core charges (as attributes)
    - wholesale prices that calculate properly with - 'product priced by attribute' and 'included in base price'
    - wholesale filters are available for payment and shipping

    How it works?
    ZenCart has a flow, start to finish. You start as a guest, then sign up, then log in, shop and exit.

    Without changing that flow, this module simply filters the display if you have a '1' beside your name.
    - The 'if customers_wholesale switch absolutely equals 1' statements are the filters.
    - Wholesale variables have _w added to them like product_price and product_price_w.
    - This module does not change how any part of the cart works, it simply mirrors what already does work.

    Important Notes:
    This module has been coded as a 'price plus' addon, discount pricing/group pricing is not included in the wholesale filters.
    - Yes it is possible to add the filters in.

    Visit twitchtoo.com, click the ZenCart link, find this module in the list and view the final output screenshots.

    Installing this module...
    Twitch Base_Cost - optional
    Twitch List_Price - optional
    Twitch Wholesale
    Twitch Wholesale Attributes

    I would recommend installing all of the modules, chances are you'll need/use the other features in the future.

    Background
    Around 2011 I developed this module for ZenCart 1.39h, it's been working flawlessly ever since. Unfortunately a divorce got in the way of releasing a full version with instructions. So I spent the last 6 weeks rewriting it from scratch for ZenCart 1.51, testing the new version and recording each step along the way.

    The resulting module is the baseline split for wholesale/retail that should come in every stock ZenCart 1.51.

    See this module it in action!
    http://www.twitchparts.com/
    Twitch.
    http://www.twitchtoo.com - Do you work for free? Please donate.
    Twitch Wholesale PRO, ZC 1.38 - 1.57c - Expert Site Migration & Upgrades!

  2. #2
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    red flag Re: Twitch Wholesale with Twitch Wholesale Attributes

    Very great works!
    One suggestion: if special price is < wholesale price, wholesaler see and buy at special price; if special price is > wholesales price, wholesaler see and buy at whole price!
    Or (better) wholesaler can't see special retail prices!
    I've just installed your great contrib, and special price is always show, also by wholesaler.

  3. #3
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,689
    Plugin Contributions
    22

    Default Re: Twitch Wholesale with Twitch Wholesale Attributes

    Thanks 100asa.

    Please clearly define what you are calling the 'special price'.

    When installed correctly guests can see the 'retail price', logged in retail customers see the same 'retail price' and if a wholesale customer logs in they will see the 'wholesale price'. The 'list price' will be seen by all customers regardless. The 'base price' is only viewable in admin.

    As mentioned, this module has not been coded to filter any 'discount pricing' modules... but it's on the way :)
    Twitch.
    http://www.twitchtoo.com - Do you work for free? Please donate.
    Twitch Wholesale PRO, ZC 1.38 - 1.57c - Expert Site Migration & Upgrades!

  4. #4
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default Re: Twitch Wholesale with Twitch Wholesale Attributes

    special price is the special offer of zencart default
    see it at http://www.100asa.it/newcart/index.p...&products_id=3
    Click image for larger version. 

Name:	wholesale.PNG 
Views:	162 
Size:	20.1 KB 
ID:	13425

  5. #5
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,689
    Plugin Contributions
    22

    Default Re: Twitch Wholesale with Twitch Wholesale Attributes

    Thanks for the screenshot 100asa.

    Your example uses ZenCart's default in Admin->Catalog->Specials
    It applies a 'special price' to individual products.

    Here's the filter you will need to hide the 'special price' entirely from wholesale customers:
    includes/functions/functions_prices.php
    replace line 25 - 31:

    Code:
        $specials = $db->Execute("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status='1'");
        if ($specials->RecordCount() > 0) {
    //      if ($product->fields['products_priced_by_attribute'] == 1) {
            $special_price = $specials->fields['specials_new_products_price'];
        } else {
          $special_price = false;
        }
    with this:

    Code:
    // bof Twitch Wholesale - Hide ZC Special Price from wholesale customer
    if ($_SESSION['customers_wholesale']=='1') {
    // Do not show wholesale customers the special price on any product
    } else {
    
         $specials = $db->Execute("select specials_new_products_price from " .  TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and  status='1'");
        if ($specials->RecordCount() > 0) {
    //      if ($product->fields['products_priced_by_attribute'] == 1) {
            $special_price = $specials->fields['specials_new_products_price'];
        } else {
          $special_price = false;
        }
    }
    // eof Twitch Wholesale - Hide ZC Special Price from wholesale customer

    Here's the before and after image tested on ZenCart v1.51 with Twitch Wholesale + Attributes installed:
    Click image for larger version. 

Name:	twitch_wholesale_ZC_special_price_REMOVE.jpg 
Views:	216 
Size:	70.1 KB 
ID:	13426

    Guests and Retail Customers will see the 'special price' as usual. There are no changes to the Admin.
    Twitch.
    http://www.twitchtoo.com - Do you work for free? Please donate.
    Twitch Wholesale PRO, ZC 1.38 - 1.57c - Expert Site Migration & Upgrades!

  6. #6
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default Re: Twitch Wholesale with Twitch Wholesale Attributes

    Great, great, great: simply great!
    Click image for larger version. 

Name:	whole1.PNG 
Views:	135 
Size:	19.0 KB 
ID:	13427

  7. #7
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default Re: Twitch Wholesale with Twitch Wholesale Attributes

    a little bugs:
    Click image for larger version. 

Name:	twitch3.jpg 
Views:	141 
Size:	34.0 KB 
ID:	13432
    as you can see, for wholesale the price in product info page is right; but in the option the price is the retail price!
    (euro 3 is wholesale price, and 4.96 is the retail price)
    Last edited by 100asa; 1 Dec 2013 at 06:08 PM.

  8. #8
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,689
    Plugin Contributions
    22

    Default Re: Twitch Wholesale with Twitch Wholesale Attributes

    Assuming you're populating a stock ZenCart v1.51 - See the attached image for reference...

    Click image for larger version. 

Name:	100asa_product_options.jpg 
Views:	187 
Size:	57.3 KB 
ID:	13433

    Step 1 - Admin-> Product Page

    Step 2 - Live Site -> Product Page

    Step 3 - Admin -> Attribute Controller

    Notes:
    - The 'Wholesale Price' at the top of the product page - step 1 is not related to the options values by default.

    - Assuming you added option names/values in the manner shown in step 3, you can see the wholesale values are displaying correctly on the live product page - step 2 when the module is properly installed.

    Check that you have correctly uploaded includes/functions/functions_prices.php

    My guess would be one of the filters is missing... look for 'options_values_price_w' around line 131 (in the query), also line 141-147 and there's another at line 1099-1115.
    Twitch.
    http://www.twitchtoo.com - Do you work for free? Please donate.
    Twitch Wholesale PRO, ZC 1.38 - 1.57c - Expert Site Migration & Upgrades!

  9. #9
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default Re: Twitch Wholesale with Twitch Wholesale Attributes

    NOw I've setup my product so show in my admin:
    Click image for larger version. 

Name:	wholesale3.PNG 
Views:	127 
Size:	11.9 KB 
ID:	13434Click image for larger version. 

Name:	wholesale4.PNG 
Views:	133 
Size:	14.3 KB 
ID:	13435
    and always show the retail price also with wholesale account
    http://www.100asa.it/index.php?main_...oducts_id=1393
    about line 145...
    PHP Code:
    // do not select display only attributes and attributes_price_base_included is true
          
    $product_att_query $db->Execute("select options_id, price_prefix, options_values_price, options_values_price_w, attributes_display_only, attributes_price_base_included, round(concat(price_prefix, options_values_price), 5) as value from " TABLE_PRODUCTS_ATTRIBUTES " where products_id = '" . (int)$products_id "' and attributes_display_only != '1' and attributes_price_base_included='1'"" order by options_id, value"); 
    and other
    PHP Code:
    bof Twitch Wholesale Attributes this filters the wholesale price for the attribute display on product_info page
    if ($_SESSION['customers_wholesale']=='1') {
                
    $the_base_price += (($product_att_query->fields['price_prefix'] == '-') ? -1) * $product_att_query->fields['options_values_price_w'];            
    } else {
                
    $the_base_price += (($product_att_query->fields['price_prefix'] == '-') ? -1) * $product_att_query->fields['options_values_price'];
    }
    // eof Twitch Wholesale Attributes 
    and
    PHP Code:
    // bof Twitch Wholesale Attributes - filter the attributes price for wholesale
    if ($_SESSION['customers_wholesale']=='1') {
        
    // normal attributes price
        
    if ($pre_selected->fields["price_prefix"] == '-') {
          
    $attributes_price_final -= $pre_selected->fields["options_values_price_w"];
        } else {
          
    $attributes_price_final += $pre_selected->fields["options_values_price_w"];
        }
    } else {
        
    // normal attributes price
        
    if ($pre_selected->fields["price_prefix"] == '-') {
          
    $attributes_price_final -= $pre_selected->fields["options_values_price"];
        } else {
          
    $attributes_price_final += $pre_selected->fields["options_values_price"];
        }
    }
    // eof Twitch Wholesale Attributes 
    Last edited by 100asa; 1 Dec 2013 at 07:48 PM.

  10. #10
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,689
    Plugin Contributions
    22

    Default Re: Twitch Wholesale with Twitch Wholesale Attributes

    I just removed the wholesale filters at line 1099-1115 and immediately recreated the problem you are having see here:
    Click image for larger version. 

Name:	100asa_recreated_filter_issue.JPG 
Views:	109 
Size:	34.8 KB 
ID:	13436

    add the default code back in (be sure the old code is remmed out - line 1093-1098)

    Code:
    /*  // normal attributes price
        if ($pre_selected->fields["price_prefix"] == '-') {
          $attributes_price_final -= $pre_selected->fields["options_values_price"];
        } else {
          $attributes_price_final += $pre_selected->fields["options_values_price"];
        } */
    // bof Twitch Wholesale Attributes - filter the attributes price for wholesale
    if ($_SESSION['customers_wholesale']=='1') {
        // normal attributes price
        if ($pre_selected->fields["price_prefix"] == '-') {
          $attributes_price_final -= $pre_selected->fields["options_values_price_w"];
        } else {
          $attributes_price_final += $pre_selected->fields["options_values_price_w"];
        }
    } else {
        // normal attributes price
        if ($pre_selected->fields["price_prefix"] == '-') {
          $attributes_price_final -= $pre_selected->fields["options_values_price"];
        } else {
          $attributes_price_final += $pre_selected->fields["options_values_price"];
        }
    }
    // eof Twitch Wholesale Attributes
    and you'll see this:
    Click image for larger version. 

Name:	100asa_recreated_filter_issue_fix.JPG 
Views:	111 
Size:	35.5 KB 
ID:	13437


    Be sure the files are uploading correctly to your server.
    Twitch.
    http://www.twitchtoo.com - Do you work for free? Please donate.
    Twitch Wholesale PRO, ZC 1.38 - 1.57c - Expert Site Migration & Upgrades!

 

 
Page 1 of 17 12311 ... LastLast

Similar Threads

  1. Twitch Wholesale | Retail Product Control Switch
    By twitchtoo in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 20 Oct 2018, 08:09 PM
  2. v151 Twitch SaleMaker & Specials for Attributes
    By twitchtoo in forum Setting Up Categories, Products, Attributes
    Replies: 20
    Last Post: 26 Jun 2014, 01:41 PM
  3. v151 Twitch TURN OFF SaleMaker & Specials & Discount Coupons for Wholesale Customers
    By twitchtoo in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 26 Dec 2013, 08:52 AM
  4. Need to have wholesale pricing with quantity discounts for wholesale customers only..
    By littleturtlemama in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 16 Dec 2010, 04:47 AM
  5. Need to have wholesale pricing with quantity discounts for wholesale customers only..
    By littleturtlemama in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 29 Sep 2007, 10:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR