Page 28 of 28 FirstFirst ... 18262728
Results 271 to 273 of 273
  1. #271
    Join Date
    May 2005
    Location
    Sweden
    Posts
    151
    Plugin Contributions
    0

    Default

    Originally posted by audradh@May 3 2006, 06:22 AM
    I think Ringy has added this functionality to his cart. For me his post in this thread is back around page 20 or so.

    Ringy, am I correct that your changes will only work for single attribute products? BTW, if I am wrong about that I would love a copy of your code.


    Best,
    Audra
    Just to clarify, I am digging around in tpl_product_info_display.php.. All I need is to show the in stock quantity or basically just say 2-3 days dispatch.

    Also another thing, isn't it possible to inherit all variants from the original product attributes? As it is now there is alot of extra work adding the variants.

  2. #272
    Join Date
    Oct 2005
    Location
    Eastern US
    Posts
    488
    Plugin Contributions
    0

    Default

    Originally posted by grayson@Feb 14 2006, 10:27 AM
    Here's an addition that will display the actual stock amounts for each attribute next to the attribute name. You can see it in action on this product in my store.

    Open includes/modules/pages/product_info/main_template_vars_attributes.php and make the following changes:
    Replace
    Code:
     ## ## ## ##$sql = "select ## ##pov.products_options_values_id,
     ## ## ## ## ## ## ## ## ## ## ## ## ##pov.products_options_values_name,
     ## ## ## ## ## ## ## ## ## ## ## ## ##pa.*
     ## ## ## ## ## ## ## ##from ## ## ##" . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
     ## ## ## ## ## ## ## ##where ## ## pa.products_id = '" . (int)$_GET['products_id'] . "'
     ## ## ## ## ## ## ## ##and ## ## ## pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
     ## ## ## ## ## ## ## ##and ## ## ## pa.options_values_id = pov.products_options_values_id
     ## ## ## ## ## ## ## ##and ## ## ## pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
     ## ## ## ## ## ## ## ##$order_by;
    by
    Code:
     ## ## ## ##$sql = "select ## ##pov.products_options_values_id,
     ## ## ## ## ## ## ## ## ## ## ## ## ##pov.products_options_values_name,
     ## ## ## ## ## ## ## ## ## ## ## ## ##pwas.quantity,
     ## ## ## ## ## ## ## ## ## ## ## ## ##pa.*
     ## ## ## ## ## ## ## ##from ## ## ##" . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " pwas
     ## ## ## ## ## ## ## ##where ## ## pa.products_id = '" . (int)$_GET['products_id'] . "'
     ## ## ## ## ## ## ## ##and ## ## ## pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
     ## ## ## ## ## ## ## ##and ## ## ## pa.options_values_id = pov.products_options_values_id
     ## ## ## ## ## ## ## ##and ## ## ## pwas.stock_attributes = pa.products_attributes_id
     ## ## ## ## ## ## ## ##and ## ## ## pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
     ## ## ## ## ## ## ## ##$order_by;
    Next, in that same file replace:
    Code:
     ## ## ## ## ##if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_CHECKBOX or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_RADIO or $products_options->RecordCount() == 1 or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
     ## ## ## ## ## ##$products_options_value_id = $products_options->fields['products_options_values_id'];
     ## ## ## ## ## ##if ($products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_TEXT and $products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_FILE) {
     ## ## ## ## ## ## ##$products_options_details = $products_options->fields['products_options_values_name'];
     ## ## ## ## ## ##} else {
     ## ## ## ## ## ## ##// don't show option value name on TEXT or filename
     ## ## ## ## ## ## ##$products_options_details = '';
     ## ## ## ## ## ##}
     ## ## ## ## ## ##if ($products_options_names->fields['products_options_images_style'] >= 3) {
     ## ## ## ## ## ## ##$products_options_details .= $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
     ## ## ## ## ## ## ##$products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
     ## ## ## ## ## ##} else {
     ## ## ## ## ## ## ##$products_options_details .= $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
     ## ## ## ## ## ## ##$products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
     ## ## ## ## ## ##}
     ## ## ## ## ##}
    by
    Code:
     ## ## ## ## ##if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_CHECKBOX or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_RADIO or $products_options->RecordCount() == 1 or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
     ## ## ## ## ## ##$products_options_value_id = $products_options->fields['products_options_values_id'];
     ## ## ## ## ## ##if ($products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_TEXT and $products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_FILE) {
    // ## ## ## ## ## ## ##$products_options_details = $products_options->fields['products_options_values_name'];
    // gbm - replaced original line above to display attribute stock amount beside attribute
     ## ## ## ## ## ## ##$products_options_details = $products_options->fields['products_options_values_name'] . ' [' . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . ']';
     ## ## ## ## ## ##} else {
     ## ## ## ## ## ## ##// don't show option value name on TEXT or filename
     ## ## ## ## ## ## ##$products_options_details = '';
     ## ## ## ## ## ##}
     ## ## ## ## ## ##if ($products_options_names->fields['products_options_images_style'] >= 3) {
     ## ## ## ## ## ## ##$products_options_details .= $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
    // ## ## ## ## ## ## ##$products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
    // gbm - replaced original line above to display attribute stock amount beside attribute
     ## ## ## ## ## ## ##$products_options_details_noname = ' [' . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . '] ' . $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
     ## ## ## ## ## ##} else {
     ## ## ## ## ## ## ##$products_options_details .= $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
    // ## ## ## ## ## ## ##$products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
    // gbm - replaced original line above to display attribute stock amount beside attribute
     ## ## ## ## ## ## ##$products_options_details_noname = ' [' . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . '] ' . $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
     ## ## ## ## ## ##}
     ## ## ## ## ##}
    Then open includes/languages/english/your_template/product_info.php and add the following line:
    Code:
    define('TEXT_ATTRIBUTES_PIECES','pieces');
    Repeat for all languages in your store.
    This post by Grayson earlier in the thread might be of use to you.

    Also another thing, isn't it possible to inherit all variants from the original product attributes? As it is now there is alot of extra work adding the variants.
    Yes. Choose attributes for the original product. You will then find a copy option that will allow you to choose another product to copy the attributes to.

    I believe that you can also globally do this, although I have not personally used that feature. Be sure to backup if copying globally.

    Not sure if I'm answering your questions. HTH,
    Audra

  3. #273
    Join Date
    May 2005
    Location
    Sweden
    Posts
    151
    Plugin Contributions
    0

    Default

    Thanks for the reply audra but thats not what I'm asking for. I want the stock for attributes to be autopopulated with 0, this meaning that I don't have to open every single variant of a product but only the ones I actually have in stock.

    I might sound lazy but having approx. 2000 products with attributes (an average of 5 attributes/product) will give me alot to do just inserting variants.

    I'm just running a small business where the majority of my products are available at suppliers.

    Pre-filling the variants with 0 would help me out alot!

 

 
Page 28 of 28 FirstFirst ... 18262728

Similar Threads

  1. v151 Stock by Attributes - managing generic stock used to sell different products
    By n_t_r in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 5 Feb 2013, 11:30 PM
  2. Different payment methods for different product attributes
    By Krosmanitz in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 7 Mar 2008, 09:01 PM
  3. Add Stock-By-Attributes without losing old information?
    By erikb in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 13 Mar 2007, 05:26 AM

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