Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2010
    Posts
    5
    Plugin Contributions
    0

    Default Attribute Controller: Update with new settings/prices, DO NOT add new ones?

    In the store I'm maintaining, I need to change the extra cost of different sizes of clothing. Although the prices that correspond to the different sizes of each product remain the same for all of the products in that category, each product has a different range of sizes.

    What I want to do is edit the product in that category with the largest range of sizes with the correct size pricing, then use the "copy to category" feature to update the size pricing for the rest of the products of that category. The problem is, there is no option on the "copy to category" page to do this. The closest option on that page, "Update with new settings/prices, then add new ones" won't work because I do NOT want to add extra sizes to products that shouldn't have them.

    All I would need is an "Update with new settings/prices, and DO NOT add new ones" option and everything would work out perfectly. I was going to try to add this option by editing attributes_controller.php but I wanted to see if anyone else had a solution already. If I end up writing the solution I'll be sure to post it here.

    Much appreciated

  2. #2
    Join Date
    Jul 2010
    Posts
    5
    Plugin Contributions
    0

    Default Re: Attribute Controller: Update with new settings/prices, DO NOT add new ones?

    bump

    I tried making a mod of the attributes_controller on my own but I'm honestly not sure where to start.

    I see this:

    // attributes copy to product
    case 'update_attributes_copy_to_product':
    $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
    $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
    $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
    zen_copy_products_attributes($_POST['products_filter'], $_POST['products_update_id']);
    $_GET['action']= '';
    $products_filter = $_POST['products_update_id'];
    zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $_POST['current_category_id']));
    break;

    // attributes copy to category
    case 'update_attributes_copy_to_category':
    $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
    $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
    $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
    if ($_POST['categories_update_id'] == '') {
    $messageStack->add_session(WARNING_PRODUCT_COPY_TO_CATEGORY_NONE . ' ID#' . $_POST['products_filter'], 'warning');
    } else {
    $copy_to_category = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $_POST['categories_update_id'] . "'");
    while (!$copy_to_category->EOF) {
    zen_copy_products_attributes($_POST['products_filter'], $copy_to_category->fields['products_id']);
    $copy_to_category->MoveNext();
    }
    }
    $_GET['action']= '';
    $products_filter = $_POST['products_filter'];
    zen_redirect(zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $products_filter . '&current_category_id=' . $_POST['current_category_id']));
    break;

    }
    }

    Anyone have an idea to get started? If I could even change the option so that it doesn't add new attributes it would save me so much time.
    Thanks.

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,474
    Plugin Contributions
    6

    Default Re: Attribute Controller: Update with new settings/prices, DO NOT add new ones?

    I am not sure how many Categories of Products that you have are, but at the top of the Attributes Controller, when looking at a Product with Attributes, is the button to Copy to Category ... this is made to copy the Attributes from the displayed Product to a Category and all of the Products in it ...

    Would that help you manage this issue?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Apr 2011
    Location
    England
    Posts
    16
    Plugin Contributions
    0

    Default Re: Attribute Controller: Update with new settings/prices, DO NOT add new ones?

    Hi eztx

    Did you ever solve this? We also need to have an ATTRIBUTE COPY AND UPDATE that does not add new attributes to the other products in the category.

    It can't be that rare. Our products each come in several sizes, and are grouped by category. However not all products in the category come in all of the sizes.

    So for example category A will have 5 products, and each product will be available in from 1 to 4 sizes.

    Category A
    Product 1 sizes S M L XL
    Product 2 sizes M L XL
    Product 3 sizes S M L
    Product 4 sizes S M L XL
    Product 5 sizes XL

    We'd like to update product 1 prices (ie any product that is available in all 4 sizes), then use a new "Update with new settings/prices, DO NOT add new ones" function to update all of the prices on the other products in the category, but without adding the new sizes to the other products.

    We currently have to do it manually, but with around 400 categories, 1000+ products, and with from 1 to 12 sizes per product, it is a time consuming job.

  5. #5
    Join Date
    Apr 2011
    Location
    England
    Posts
    16
    Plugin Contributions
    0

    Default Re: Attribute Controller: Update with new settings/prices, DO NOT add new ones?

    Further to previous post, and if anyone is reading this , then I guess there are two places that may need changing.

    1. ATTRIBUTES CONTROLLER

    /admin/attributes_controller.php
    which calls...

    2. DATABASE ACCESS

    /admin/includes/functions/general.php
    and specifically the function 'zen_copy_products_attributes'

    But I think this level of SQL and PHP is beyond me. Also messing about with either of these two files could do quite a bit of damage!

    Any experts out there who can help.

  6. #6
    Join Date
    Apr 2011
    Location
    England
    Posts
    16
    Plugin Contributions
    0

    Default Re: Attribute Controller: Update with new settings/prices, DO NOT add new ones?

    bump

 

 

Similar Threads

  1. v139h Can't update existing products or add new ones
    By Eldridge in forum Setting Up Categories, Products, Attributes
    Replies: 14
    Last Post: 28 Mar 2014, 02:19 AM
  2. v151 Botched my EZ pages - can't add any new ones
    By PJWings in forum Basic Configuration
    Replies: 6
    Last Post: 29 Mar 2013, 11:20 PM
  3. Replies: 1
    Last Post: 25 Feb 2013, 02:27 AM
  4. Cannot add new titles only old ones
    By billscheltema in forum General Questions
    Replies: 2
    Last Post: 15 Jan 2009, 01:26 PM
  5. FAQ - How do i add new ones
    By mfashraf in forum General Questions
    Replies: 1
    Last Post: 20 Jan 2008, 01:35 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