Zen Cart Logo
Forums / All Other Contributions/Addons / Twitch Attribute Button

Twitch Attribute Button

Views: 1,313

Results 1 to 7 of 7
15 Aug 2014, 5:22 PM
#1
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Twitch Attribute Button

UPDATED for ZC 1.53 - Twitch Attribute Button
(Yes it works with ZC 1.51 also - line numbers are slightly different)

Lets add a shortcut button to the attributes_controller on the product listing page, and the product page!
admin/includes/modules/category_product_listing.php
replace line 28 with:
<td class="smallText" align="left">

replace line 41 - 42 with:
?>
    <a href="<?php echo zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '', 'NONSSL') ?>"><?php echo zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES); ?></a>    
</td>

This will now drill down to the associated attribute if there is one attached already.
admin/includes/modules/product/collect_info.php
replace line 321 - 324
<tr>
<td class="main"><?php echo TEXT_PRODUCTS_PRICED_BY_ATTRIBUTES; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('products_priced_by_attribute', '1', $is_products_priced_by_attribute) . ' ' . TEXT_PRODUCT_IS_PRICED_BY_ATTRIBUTE . '  ' . zen_draw_radio_field('products_priced_by_attribute', '0', $not_products_priced_by_attribute) . ' ' . TEXT_PRODUCT_NOT_PRICED_BY_ATTRIBUTE . ' ' . ($pInfo->products_priced_by_attribute == 1 ? '<span class="errorText">' . TEXT_PRODUCTS_PRICED_BY_ATTRIBUTES_EDIT . '</span>' : ''); ?>
 

<?php // bof Twitch Attribute Button if (zen_has_product_attributes($pInfo->products_id, 'false')) { //show attributes exist - use attribute change split screen - global filters //echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id .'&action=attribute_features' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . ((!empty($pInfo->products_id) && zen_has_product_attributes($pInfo->products_id, 'false')) ? zen_image(DIR_WS_IMAGES . 'icon_attributes_on.gif', ICON_ATTRIBUTES) : zen_image(DIR_WS_IMAGES . 'icon_attributes.gif', ICON_ATTRIBUTES)) . ' Edit Attribute</a> (Attributes Found)'; //show attributes exist - go directly to associated attribute echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_attributes_on.gif', ICON_ATTRIBUTES) . ' Edit Attribute</a> (Attributes Found)'; } else { // no associated attributes found echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image(DIR_WS_IMAGES . 'icon_attributes.gif', ICON_ATTRIBUTES) . ' Add Attribute</a> (No Attributes Found)'; } // eof Twitch Attribute Button ?>
        </td>
      </tr>

Code is included for anyone that would prefer the native 'attribute change' split screen additional step.
**
Enjoy.**

30 Jan 2016, 4:24 AM
#2
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Twitch Attribute Button

This works for ZC v1.54.:hug:

30 Jan 2016, 5:22 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Twitch Attribute Button

What is the real point of this?

You edit the Product to make a number of changes, and click that Edit link for the Attributes which takes you to Attributes Controller and lose all of your Product Edits as they were never saved ... :lookaroun

31 Jan 2016, 4:18 PM
#4
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Twitch Attribute Button

Ajeh,
When managing products clients can now:

  • See if the product has attributes attached while you're managing it.

  • Bypass use of the category listing pages entirely - saves looking through the list again to find the product then click the attributes button, especially with multi page listings or products with similar names.

  • Single click to drill directly to a product with it's attributes already selected for you. Using the existing attribute button requires 2 clicks minimum and some reading of the split screen.

When Twitch Admin Product Thumbnails is installed along with the Attributes Thumbnails Pack all of the ancient text based admin screens instantly become user friendly and easy on the eyes... with single click attributes straight from the product - product management times drop substantially.

So you could visually look at the category listing and see the product image, then perhaps you clicked it to review the product margins or wholesale/retail pricing and thought 'I should check the attributes... does it have any?' Click! There they are along with more pictures to see.

If you wanted to edit anything you could always go back or click the edit buttons and make your changes.

31 Jan 2016, 4:36 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Twitch Attribute Button

I still think too many people are going to try to use that link when editing a Product not complete the changes/edits and have more issues than not because of that link to the attributes ...

The click of the A that already indicates Attributes (when blue) or no attributes (when black) is pretty clear for know what will happen if you click the A ...

It will probably be come more of a problem than a help so I would not encourage its use ... :(

31 Jan 2016, 5:00 PM
#6
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Twitch Attribute Button

Ajeh,
All of my clients have been using this since 2014... none have complained or even had any problems understanding how to use it. I haven't even received one email regarding this from anyone in the Zen Cart forum in 2 years :D

Let's move on with improving the attributes module shall we :)

31 Jan 2016, 5:11 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Twitch Attribute Button

Post something that is really an improvement and I would be happy to say as much ...

But I cannot express any encouragement on this link that really isn't saving time for anything and introducing issues on editing products ...

What is the difference between 1 Click to edit the Product and 1 Click on your link (2 clicks) and 1 click on the A for the product and 1 Click on the Attributes Controller button (2 clicks) ... kind of the same difference, except the current method prevents someone from editing the product (your method) and making changes then clicking on you link to go to the Attributes Controller and lose their un-saved edits ... sounds like a different "2 clicks" to get to the Attributes Controller ... :lookaroun