Re: Stock by Attributes 5.0 Beta (for v1.5.0)
Quote:
Originally Posted by
mc12345678
Thank you Diva for the summary. Fortunately I didn't find a copy of the robophung version on the one computer I was looking in, and based on the above I will stop that search. Also, the mod I did for EP4, I will make corrections as necessary, including a note to appear suggesting that the above version be used in place of the one tested for if mods are identified in how I've written the additional code. (For others, this means that I will keep the existing code in place to support those that have come to use it and "refuse" to upgrade, but that the "new" version will be the one that will be incorporated.)
Timeline unknown, but this is the type of input I was hoping to hear. I realize that some of the above is opinion, but if it has been identified as the "fix" to some of the base issues then that is the direction I plan to assist with until something "better" is developed.
ALL of what I wrote is of course my opinion..:smile: I've had strong opinions about SBA and these silly forks of SBA for YEARS.. I liked the ORIGINAL version Kuroi developed, but I knew it ad flaws, and I never like the fact that ther was no way to exclude attributes from a product inventory variant. So I paid a developer to update the ORIGINAL Kuroi version of SBA so that my ONE client who uses it could use it while I continued to watch and wait for the SBA scene to improve.
(and before anyone asks.. why didn't I share this version of SBA?? I didn't because my client would NOT sign off on contributing it --she had paid for these improvements and didn't want to share-- and I didn't want to submit something I had NO PLANS to support..)
I am FIRMLY of the opinion that all this forking of SBA was unnecessary and made SBA a USELESS and WEAK add-on for the community as a whole.. It's great that some folks are able to use some of these forked versions in their stores, but others are not.. The MANY ad-hoc SBA threads is proof of this.. the fact that Numinix developed a commercial product variant module is proof of this, the fact that the late Conor Kerr was developing a HIGHLY anticipated product variants module is further proof of the fact that all this SBA forking has not resulted in a universally USEFUL add-on and a GAP in this kind of functionality still exists..
This all only serves to illustrate my point that these forks only served to dilute the whole by creating multiple WEAK versions of SBA. potteryhouse at LEAST is trying to create ONE functioning version of SBA by bringing together features from these MANY forks.. If you are looking to contribute to the SBA landscape, why continue development on one of these WEAK A$$ED half supported (NON SUPPORTED) forks?? If you have enhancements that allow EP4 to work with SBA (which I THINK is what you are saying you have been working on) then add those to the effort potteryhouse has put into SBA because in MY OPINION he's trying to improve the clusterf*ck wasteland that SBA had become..
IJS:blink:
Re: Stock by Attributes 5.0 Beta (for v1.5.0)
Why doesn't someone ask me to rebuild the SBA... so it works... like it should?
Better yet, why hasn't the core development team done it for say version 1.51 or 1.52 or 1.60... ?
These are essential functions an e-commerce platform should have period.
Re: Stock by Attributes 5.0 Beta (for v1.5.0)
Quote:
Originally Posted by
twitchtoo
Why doesn't someone ask me to rebuild the SBA... so it works... like it should?
Better yet, why hasn't the core development team done it for say version 1.51 or 1.52 or 1.60... ?
These are essential functions an e-commerce platform should have period.
the SBA core has always been available for improvement.. potteryhouse is the first maintainer who has been working hard to make SBA usable and unified.. you wouldn't consider collaborating with him??
Re: Stock by Attributes 5.0 Beta (for v1.5.0)
Quote:
Originally Posted by
DivaVocals
ALL of what I wrote is of course my opinion..:smile: I've had strong opinions about SBA and these silly forks of SBA for YEARS.. I liked the ORIGINAL version Kuroi developed, but I knew it ad flaws, and I never like the fact that ther was no way to exclude attributes from a product inventory variant. So I paid a developer to update the ORIGINAL Kuroi version of SBA so that my ONE client who uses it could use it while I continued to watch and wait for the SBA scene to improve.
(and before anyone asks.. why didn't I share this version of SBA?? I didn't because my client would NOT sign off on contributing it --she had paid for these improvements and didn't want to share-- and I didn't want to submit something I had NO PLANS to support..)
I am FIRMLY of the opinion that all this forking of SBA was unnecessary and made SBA a USELESS and WEAK add-on for the community as a whole.. It's great that some folks are able to use some of these forked versions in their stores, but others are not.. The MANY ad-hoc SBA threads is proof of this.. the fact that Numinix developed a commercial product variant module is proof of this, the fact that the late Conor Kerr was developing a HIGHLY anticipated product variants module is further proof of the fact that all this SBA forking has not resulted in a universally USEFUL add-on and a GAP in this kind of functionality still exists..
This all only serves to illustrate my point that these forks only served to dilute the whole by creating multiple WEAK versions of SBA. potteryhouse at LEAST is trying to create ONE functioning version of SBA by bringing together features from these MANY forks.. If you are looking to contribute to the SBA landscape, why continue development on one of these WEAK A$$ED half supported (NON SUPPORTED) forks?? If you have enhancements that allow EP4 to work with SBA (which I THINK is what you are saying you have been working on) then add those to the effort potteryhouse has put into SBA because in MY OPINION he's trying to improve the clusterf*ck wasteland that SBA had become..
IJS:blink:
Sorry for the "delayed" response, but no argument from me. :) I actually halted some development because I didn't want to make a bigger mess of things. The recent developer of ep4 has indicated that a zc ready version would be coming "soon" and with all the variations of sba I wanted to focus on the aspect of sba/ep that seemed most valuable. Updating in stock quantities of sba tracked products. That task was done for a particularly lain out sba table.
Having the next suggested version of sba I should be able to look at the tables used there and make the mods to accomodate restock of existing sba tracked products. And do so without losing existing functionality, but I plan on providing a note to guide towards the "preferred" sba.
SBA, while probably one of the most useful of setups for an online store, HAS unfortunately been ##############ized it certainly also unfortunately can be one of the more complex plugins because of how many different facits that are affected by it/it affects. I'm looking to finish some touchups to another plugin I am merging with a convenient tool which also needs to have/get an autoinstaller tied to it and then I'll switch back over to the improvements for SBA/EP4 through potteryhouse's version. That part shouldn't be as difficult after I play with his version a little.
Re: Stock by Attributes 5.0 Beta (for v1.5.0)
Quote:
Originally Posted by
mc12345678
Sorry for the "delayed" response, but no argument from me. :) I actually halted some development because I didn't want to make a bigger mess of things. The recent developer of ep4 has indicated that a zc ready version would be coming "soon" and with all the variations of sba I wanted to focus on the aspect of sba/ep that seemed most valuable. Updating in stock quantities of sba tracked products. That task was done for a particularly lain out sba table.
Having the next suggested version of sba I should be able to look at the tables used there and make the mods to accomodate restock of existing sba tracked products. And do so without losing existing functionality, but I plan on providing a note to guide towards the "preferred" sba.
SBA, while probably one of the most useful of setups for an online store, HAS unfortunately been ##############ized it certainly also unfortunately can be one of the more complex plugins because of how many different facits that are affected by it/it affects. I'm looking to finish some touchups to another plugin I am merging with a convenient tool which also needs to have/get an autoinstaller tied to it and then I'll switch back over to the improvements for SBA/EP4 through potteryhouse's version. That part shouldn't be as difficult after I play with his version a little.
Yep.. Because HONESTLY the BEST WAY to improve the SBA module and have a version of SBA "so it works... like it should" is to start by just letting these other half baked SBA forks DIE.. potteryhouse has integrated their features into the SBA version he has been maintaining anyway so IMHO, there is no need to continue development of these forks.. Additionally I like the way potteryhouse seems to be working to ACTIVELY improve SBA's features.. Some of the features he's adding appear to rival the features that were supposed to be a part of the late Conor Kerr's Products Variants add-on. (unfortunately, in the year since Conor's passing I have seen no signs from the folks at JS Web that Conor Kerr's Products Variants add-on will be released anytime soon..)
Re: Stock by Attributes 5.0 Beta (for v1.5.0)
I did a search but came up empty. Is there a way to report sales that includes the attribute? My client, a non-profit fog rescue, sells t-shirts and tracks inventory by size. The plugin is great for the site, but they need a report on sales to update inventory. The Sales Report plugin does not include attribute data.
Re: Stock by Attributes 5.0 Beta (for v1.5.0)
Quote:
Originally Posted by
jeking
I did a search but came up empty. Is there a way to report sales that includes the attribute? My client, a non-profit fog rescue, sells t-shirts and tracks inventory by size. The plugin is great for the site, but they need a report on sales to update inventory. The Sales Report plugin does not include attribute data.
You probably should open a new thread to get this discussion going.. SBA doesn't have any reporting mechanism..
Re: Stock by Attributes 5.0 Beta (for v1.5.0)
Quote:
Originally Posted by
jeking
I did a search but came up empty. Is there a way to report sales that includes the attribute? My client, a non-profit fog rescue, sells t-shirts and tracks inventory by size. The plugin is great for the site, but they need a report on sales to update inventory. The Sales Report plugin does not include attribute data.
I came up with a solution for this that involves only php changes and no database additions. I am reluctant to share it because it's queries are very intensive and a product with 100+ attributes can take several minutes to return results. For our business this data was essential, so it was worth the cost for us. I modified the stats_products_purchased.php file to add the following code:
PHP Code:
<!-- BOF FGB Attribute Sales Report -->
<table border="0" width="80%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="80%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo "Best Attributes Purchased"; ?></td>
<td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
<td class="smallText" align="right">
<?php
// field for user to enter two order numbers to search between
echo zen_draw_form('search', FILENAME_STATS_PRODUCTS_PURCHASED, '', 'get', '', true);
echo "Enter two order numbers seperated by a comma:" . ' ' . zen_draw_input_field('order_numbers') . zen_hide_session_id();
echo '<br/ >' . "Enter one product ID number:". ' ' . zen_draw_input_field('product_id') . zen_hide_session_id();
?><input type="submit"><?php
echo '</form>';
?>
</td>
</tr>
</table></td>
</tr>
<?php
echo $_GET["order_numbers"]; ?><br><?php
echo $_GET["product_id"]; ?><br><?php
// create orders_id_array to hold all orders_products_id arrays
$orders_id_array = array();
$our_product_number = 7;
$our_beginning_order_number = 20500;
$our_ending_order_number = 30000;
// if the user has entered and submitted some order numbers, use those
if (!(is_null($_GET["order_numbers"]))) {
$order_numbers = explode(",", $_GET["order_numbers"]);
$our_beginning_order_number = $order_numbers[0];
$our_ending_order_number = $order_numbers[1];
}
// if the user has entered and submitted an item number, use that
if (!(is_null($_GET["product_id"]))) {
$our_product_number = $_GET["product_id"];
}
// building query from orders_products table for product quantity, id, name, and orders_products_id
// need to add user input fields for order range and product id
$attributes_query_raw=
"select op.products_quantity, op.orders_products_id, op.products_name, op.products_id
from ".TABLE_ORDERS_PRODUCTS." op
where (op.orders_id BETWEEN $our_beginning_order_number AND $our_ending_order_number) AND op.products_id = $our_product_number";
// fire off this query
$attributes = $db->Execute($attributes_query_raw);
// loop though all returned records
while(!$attributes->EOF) {
// create orders_products_id_array to hold the fields for each purchase
$orders_products_id_array = array();
// push these onto our orders_id array
array_push($orders_products_id_array, $attributes->fields['products_id'],
$attributes->fields['orders_products_id'],
$attributes->fields['products_quantity'],
$attributes->fields['products_name']);
// grab orders_products_id to use when filtering variants query
$var_opi = $attributes->fields['orders_products_id'];
// building query from orders_products_attributes table for product options values and orders_products_id
$variants_query_raw=
"select products_options_values, orders_products_id
from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . "
where orders_products_id=$var_opi";
// fire off this query
$variants = $db->Execute($variants_query_raw);
// loop though all returned records
while(!$variants->EOF) {
// push this attribute to the end of our orders_id array
$orders_products_id_array[] = $variants->fields['products_options_values'];
// move on to the next attribute option value if there is one
$variants->MoveNext();
} // while loop completed; orders_products_id array completed
// push this completed orders_products_id array onto the larger products_id array
$orders_id_array[] = $orders_products_id_array;
// move on to the next orders_products_id if there is one
$attributes->MoveNext();
} // while loop completed; orders_id array completed
// funtion to sort on the first attribute (e.g. tip size)
function cmp_first_attribute($a, $b) {
if ($a[4] == $b[4]) {
return strcmp($a[5], $b[5]);
}
return strcmp($a[4], $b[4]);
}
// function to sort on the second attribute (e.g. color)
function cmp_second_attribute($a, $b) {
return strcmp($a[5], $b[5]);
}
// function to sort on the quantity
function cmp_quantity($a, $b) {
if ($a[2] == $b[2]) {
return 0;
}
return ($a[2] > $b[2]) ? -1 : 1;
}
// sort the orders_id array so that all the matching products are adjacent
usort($orders_id_array, "cmp_first_attribute");
// we should check if this index exists before sorting, this might break on single attribute products
//usort($orders_id_array, "cmp_second_attribute");
// create new array to hold summed quantitys of attributes purchased
$summed_quantities = array();
// create tokens to hold our summed array index and product attribute options while traversing orders_id array
$summed_quantities_index = -1;
$product_name_token = array(4=>'',5=>'');
// create loop that pulls each unique combination of attributes out of orders_id array` and summs their quantities
foreach ($orders_id_array as $orders_id_line) {
// if we are starting on a new set of attribtues, set the name token and incriment the summed array index
if (($orders_id_line[4] != $product_name_token[4]) || ($orders_id_line[5] != $product_name_token[5])) {
$product_name_token[4] = $orders_id_line[4];
$product_name_token[5] = $orders_id_line[5];
$summed_quantities_index++;
// since we are on a new set of attributes, populate the next array in summmed_quantities with
// our new info, and set quantity to zero
$summed_quantities[$summed_quantities_index] = $orders_id_line;
$summed_quantities[$summed_quantities_index][2] = 0;
}
// if this is another instance of the same set of attributes wer were already working with,
// add the quanitity of this new instance to our running total
$summed_quantities[$summed_quantities_index][2] = $summed_quantities[$summed_quantities_index][2] + $orders_id_line[2];
}
// sort our summed list in descending order by quantity
usort($summed_quantities, "cmp_quantity");
// build table header row for Best Attributes Table
?>
<tr>
<td><table border="0" width="80%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="80%" cellspacing="0" cellpadding="2">
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent"><?php echo "Product Name"; ?></td>
<td class="dataTableHeadingContent"><?php echo "Attribute"; ?></td>
<td class="dataTableHeadingContent"><?php echo "Attribute"; ?></td>
<td class="dataTableHeadingContent"><?php echo "Quantity"; ?></td>
</tr>
<?php
if (isset($_GET['page']) && ($_GET['page'] > 1)) $rows = $_GET['page'] * MAX_DISPLAY_SEARCH_RESULTS_REPORTS - MAX_DISPLAY_SEARCH_RESULTS_REPORTS;
$rows = 0;
foreach ($summed_quantities as $summed_quantity) {
$rows++;
if (strlen($rows) < 2) {
$rows = '0' . $rows;
}?>
<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
<td class="dataTableContent"><?php echo $summed_quantity[3]; ?> </td>
<td class="dataTableContent"><?php echo $summed_quantity[4]; ?></td>
<td class="dataTableContent"><?php echo $summed_quantity[5]; ?></td>
<td class="dataTableContent"><?php echo $summed_quantity[2]; ?></td>
</tr><?php
}
?>
</table></td>
</tr>
<tr>
<td colspan="3"><table border="0" width="80%" cellspacing="0" cellpadding="2">
<tr>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
<!-- EOF FGB Attribute Sales Report -->
I hope this helps.
Re: Stock by Attributes 5.0 Beta (for v1.5.0)
Every six months or so I get fed up of avoiding this huge hole in Zen Cart, look at other carts and come back to look over the state of SBA and discount this mess and go back to avoiding it. A great example of the worst case scenario of the basically uncontrolled "plugins" mechanism.
I know that if I got involved with it I would spend too much time fixing it before adding it to my shop.
Thanks to divavocals for the summary of the current state of affairs.
Quote:
Better yet, why hasn't the core development team done it for say version 1.51 or 1.52 or 1.60... ?
These are essential functions an e-commerce platform should have period.
I think it is evident this functionality is essential but the SBA band-aid attempt only serves to illustrate that it requires too many changes to core code to work, wasted development time in the 1.x branch which cannot be carried to the 2.x framework.
The few people I knew using ZC (in Spain) have long since jumped ship for Prestashop due to this and I don't recommend ZC to new users for the same reason.
And yes, knowing that Conor's Product Variants (which I believe was complete bar documentation) is still apparently gathering dust at JSweb is something that does not bear thinking about...
Re: Stock by Attributes 5.0 Beta (for v1.5.0)
It is necessary to have a way of showing stock by attributes.If you have a garment in three sizes you have to be able to show customers you are out of stock in one size and have stock in the others.
But I've never had a problem with this add-on. The Pottery House version has always given me errors . I've just updated to version 1.5.3. and it works fine. You do need to make a couple of changes that are in this thread somewhere.
You do have to update stock manually but you just type the product code in and SBA brings it up no problem.
If you only sell a few things a day you really don't need anything else. If you sell hundreds of items a day that all have attributes then,yes ,you probably do.