Zen Cart Logo
Forums / All Other Contributions/Addons / Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Views: 658,734

Results 241 to 260 of 3,609
18 Jul 2007, 1:47 PM
#241
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Stock by Attribute v4.0 addon for v1.3.5-1.3.9

I have a problem with my store.

I can add a product to the shopping cart when the product has no attributes, but if the product has attributes, it is not possible to click on the 'add to cart' button. (I have sba v4.4 installed using Zen Cart 1.3.7.1, and, as far as I can tell, all the relevant files for the mod are in the correct places)

The button appears to be disabled when the customer wishes to add a product to the cart, and since this seems to be the case only for products with attributes, I am assuming that the problem is related to sba.

I have double-checked everything, as far as I can, but I don't seem to be able to fix the problem - can anyone shed some light on what might be causing this critical phenomenon, PLEASE?

19 Jul 2007, 12:53 PM
#242
xman888 avatar

xman888

Zen Follower

Join Date:
Jan 2007
Posts:
226
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Hello,

I installed the "Stock by Attributes" mod, and everything seemed to work fine until I made a purchase in my cart using one of the modded products.

When I arrived in my cart at the "main_page=checkout" page, it came up with the following error:

"Fatal error: Call to undefined function: zen_get_advertizer_list() in /home/xmanhos/public_html/shop/includes/templates/xman/templates/tpl_checkout_default.php on line **215" **

Has anyone had experience with this error before ?

Kind regards,
Anthony

19 Jul 2007, 6:33 PM
#243
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Does any one know if you can assign different codes to your attributes with this contribution?

For example...

Main product (code 1234)

  • size small (code 1234s)
  • size medium (code 1234m)
  • size large (code 1234l)

Thanks in advance! :)

19 Jul 2007, 6:42 PM
#244
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Alex Clarke:

Does any one know if you can assign different codes to your attributes with this contribution?Alas not. Attribute level SKUs are scheduled for inclusion in Zen Cart 1.4.

19 Jul 2007, 6:48 PM
#245
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

kuroi:

Alas not. Attribute level SKUs are scheduled for inclusion in Zen Cart 1.4.

That was going to be my next question!! Thanks for the quick reply. :)

22 Jul 2007, 8:04 AM
#246
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

BUMP! (only because I didn't receive a reply to the earlier thread in this post, and have been unable to resolve this problem- at present it's crippling my progress in making the store go live)

I have a problem with my store.

I can add a product to the shopping cart when the product has no attributes, but if the product has attributes, it is not possible to click on the 'add to cart' button. (I have sba v4.4 installed using Zen Cart 1.3.7.1, and, as far as I can tell, all the relevant files for the mod are in the correct places)

The button appears to be disabled when the customer wishes to add a product to the cart, and since this seems to be the case only for products with attributes, I am assuming that the problem is related to sba.

I have double-checked everything, as far as I can, but I don't seem to be able to fix the problem - can anyone shed some light on what might be causing this critical phenomenon, PLEASE?

Here's the generated html code for the 'dead' button, but as far as I can tell, it appears to be an active 'input' item which actually identifies the products ID:

<!--bof Add to Cart Box -->
     <div id="cartAdd">
    Add to Cart: 
<input name="cart_quantity" value="1" maxlength="6" size="4" type="text">
<br><br><input name="products_id" value="330" type="hidden">
<input src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" title=" Add to Cart " type="image">
</div>
  <!--eof Add to Cart Box-->

The products ID value is correct, but there doesn't seem to be any value for the Stock ID created by sba.

Now here's the code for an add to cart button for an item that doesn't have any attribute 'variants':

<!--bof Add to Cart Box -->
<div id="cartAdd">
Add to Cart:
<input name="cart_quantity" value="1" maxlength="6" size="4" type="text">
<br><br><input name="products_id" value="276" type="hidden">
<input src="includes/templates/template_default/buttons/english/button_in_cart.gif" alt="Add to Cart" title=" Add to Cart " type="image">
</div>
<!--eof Add to Cart Box-->

Now, since the code for these buttons appears to be identical, withe exception of the products ID, can anyone cast any light as to why one working and the other NOT?

22 Jul 2007, 8:48 AM
#247
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

xman888:

Hello,

I installed the "Stock by Attributes" mod, and everything seemed to work fine until I made a purchase in my cart using one of the modded products.

When I arrived in my cart at the "main_page=checkout" page, it came up with the following error:

"Fatal error: Call to undefined function: zen_get_advertizer_list() in /home/xmanhos/public_html/shop/includes/templates/xman/templates/tpl_checkout_default.php on line **215" **

Has anyone had experience with this error before ?

Kind regards,
AnthonyAnthony, you didn't just install Stock by Attributes, did you? You also installed One Step Checkout.

The error that you are getting refers to a non-existent function, zen_get_advertizer_list(). Not just one that it can't find, but one that is not even part of Zen Cart, or Stock by Attributes.

Moreover, the file that is calling it, tpl_checkout_default.php, doesn't exist in Zen Cart or Stock by Attributes either.

The latter does exist in the One Page Checkout mod which until today I had not looked at. Having now reviewed, I strongly recommend that you delete it and run. Happily it doesn't overwrite any of your core files, so there's no damage done to your underlying Zen Cart. In addition to missing code such as that which you are tripping over, this mod seems to have references to other undocumented add-ons that were presumably part of his install when he put this mod together (and may be the cause of your problem) as well as hard-coded references to his template.

The forum moderators have put a warning on this mod. I've never seen them do that before, so I guess that's a strong indication that they agree that it's not up to the usual quality.

22 Jul 2007, 9:06 AM
#248
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

@blag

The code for your add to cart buttons with attribute and without are correctly identical apart from the product id. No stock id is added or needed at that point.

To jump from noticing that the problem occurs only with products who have attributes to assuming that it must therefore be a problem with stock by attributes is too big a leap. Stock by Attributes is just a small part of the attributes processing and setup and I wouldn't rule out other possibilities based on what you've told us.

That said Stock by Attributes would be the first place I'd look too. The reason is because there isn't a Stock by Attributes for Zen Cart 1.3.7.1. The last version 4.4 was re-tooled specifically for Zen Cart 1.3.7 and because it affects six core files that tend to change in every release, needs to be re-tooled each tool. Three of those six files changed in between 1.3.7 and 1.3.7.1, so there's a fair chance that's what's causing your problem.

I haven't reviewed those changes, and you haven't told us specifically what happens when you try to use the button or provided a link, but if I had to guess, I would suggest looking first at the includes/modules/pages/shopping_cart/header_php.php file.

22 Jul 2007, 4:51 PM
#249
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

kuroi

Thanks for the response. Of course you are right, I may be wrongly assigning the blame to sba, and I had failed to understand that the version was 1.3.7 specific, but is it possible/likely that a file that is NOT included in the sba mod, but which IS included in the 1.3.7.1 update is causing this problem?

The add-to-cart button for a product with attributes appears to be dead: the cursor does not change to a hand, and the button is not clickable, but the 'quantity' box directly above the add-to-cart button IS editable.

BTW I have found a significant difference earlier in the html pages' output from my store, which be relevant.

If I examine the entire source for a page for a product which has no attributes I find this piece of html:

<!--bof Form start--> <form name="cart_quantity" action="http://www.hohose.exphoster.com/store/bbb001-p-242.html?action=add_product" method="post" enctype="multipart/form-data"> <!--eof Form start-->

The 'same' snippet of code for a page for a product WITH attributes (but, obviously, for a different product) is:

<!--bof Form start--> <form name="cart_quantity" action="http://www.hohose.exphoster.com/store/babette-micromesh-p-230.html?action=add_product&number_of_uploads=0" method="post" enctype="multipart/form-data"> <!--eof Form start-->

I have no downloadable products, and AFAIK I have disallowed uploads/downloads in my admin, but the file with attributes appears to make a reference to uploads, even though, presumably, there shouldn't be any such reference!!

BTW by asking WinMerge to compare the full files of 1.3.7.1 unmodified, and those contained in the most recent version of sba (in the downloads section of ZC), the following files differ:
admin/includes/stylesheet.css - the difference is that the sba 'version' makes a call to makes a call to import the stock_attributes.css, otherwise files are identical
admin/orders.php - the sba version adds two lines of code, otherwise files are identical
includes/classes/order.php - apart from various lines added by sba, there are four lines which differ; i.e. 912; 915; 918; & 956
includes/functions/functions_lookups.php all changes are made by sba, otherwise files are identical
includes/modules/pages/checkout_shipping/header_php.php additional code by sba, otherwise files are identical
includes/modules/pages/shopping_cart/header_php.php there are five additional lines in the sba file at approx line 71/72, but these same lines are to be found at line 111; line 106 of the 1.3.7.1 differs from line 113 of the sba version; other than that there are additional lines in the sba version.

By comparing the 1.3.7 and the 1.3.7.1 full filesets, I find the following differences:
admin/includes/stylesheet.css - - the files are identical
admin/orders.php - lines 457 and 813 differ.
includes/classes/order.php - lines 912; 915; 918; & 956 differ.
includes/functions/functions_lookups.php files are identical
includes/modules/pages/checkout_shipping/header_php.php files are identical
includes/modules/pages/shopping_cart/header_php.php line 106 differs

It seems to me, therefore, if the difference between the two versions is causing the problems, the culprit(s) MAY POSSIBLY lie in the elements defined in red, above. Unfortunatlely that gets me no further forward, because I wouldn't know how to fix these, unless, of course reverting to original 1.3.7 version has no consequences other than fixing my problem!!

BTW: My store can be found here

Any ideas, suggestions or help, please??

22 Jul 2007, 5:08 PM
#250
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

@blag

Always useful to give a URl and say which browser you're using. The button works perfectly in IE7. In fact it probably works perfectly in all browsers, except that when there are attributes some dodgy layout comes into play (and although it works in IE, it's actually IE that gets it wrong :shocking:).

Basically you have extended the DIV that contains your product attributes right across the screen and it is sitting on top of your add to cart button. The add to cart button is perfectly coded and working properly, you just can't get to it as it's behind an invisible barrier.

You need to tweak your stylesheet so that the button is on top, or the errant div does not take up the whole width.

BTW if you're using Firefox on PC, then you can just sneak a click at the very, very top of the button.

22 Jul 2007, 5:24 PM
#251
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

kuroi

That was a fantastically fast response.

I know that I have extensively hacked the css (although I am not an expert in css: most of my css hacks are the result of divine intervention or trial-and-error), and I felt that this might be the source/cause of the problem.

I use SeaFox as my main browser, and haven't tested the site in IE - or any other browser for that matter. I can't get a response anywhere on the button in my browser. I have tried to bring the button 'forward' by giving the div a big 'z' value in the css, but that didn't seem to work. I'll try restricting its width, but many many thanks for this insight. I was beginning to despair, because I have spent (literally, honestly) months working on the store. I'll report back soon

Secondary question - I initially included my products in secondary/linked categories, primarily for the size of my products, btu got realy weird results due to what ajeh said was a bug due to be fixed in 1.3.8. Unfortunately, because size is included as an attribute (in most cases) the search funsction doesn't find the size. Are there, to your knowledge, any improved 'search' modules - I've looked and looked but can't see anything.

22 Jul 2007, 5:31 PM
#252
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

@blag

z-index only works on elements that have been positioned (e.g. have styles like position:absolute).

I'm not aware of any other search modules. This post from a few hours ago about how to create a custom search, will probably give a big clue as to why.

22 Jul 2007, 5:52 PM
#253
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

kuroi

Thanks for the insight on custom searches!

I am really struggling to find which div is overlapping, because I can't see the overlap or a graphical 'representation' of the div!!

Are you able to determine (somehow or other) which div is causing the overlap? If so I would really apprecaite it
a) if you could advise which div it is, and
b) how you are able to determine this?

TIA

22 Jul 2007, 6:03 PM
#254
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

You actually have three elements extending right the way across: the productAttributes DIV and inside that the h3 tag and the WrapperAttribsOptions DIVs.

Three way to identify these, and they're all extensions to Firefox: CSS Viewer which lets you move round a page, giving you details of the elements that you're hovering over, the outline facility in the web developer extension and the inspect function in the firebug extension (my favourite). The web developer toolbar for Internet Explorer also has both outline find by click functions which would highlight this and the WebDev toolkit that can be used by those prefering Safari. There's also a web developer equivalent for Opera, but I haven't used that for a few months, so can't remember what facilities it has.

22 Jul 2007, 6:29 PM
#255
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

kuroi

Ho-hum!! Specifying the width of the productAttributes DIV did the job. Thank you SO much - brilliant sleuthing by you.

I think it would have taken me several months of Sundays to figure that one out, and thanks for the additional info on tools to assist in identifying the overlaps etc. I have found and successfully installed a similar one for my browser!!

First class, and give yourself a HUGE pat on the back!!

22 Jul 2007, 6:57 PM
#256
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

kuroi

Just thought I'd let you know - I found a problem with specifying the width of the productAttributes DIV, so I've 'positioned' the productAttributes DIV removed the width restriction and gave the div a 'z' value, and, of course, similarly, gave the addcart DIV a greater 'z' value so that the button 'floats' over the other DIVS!

21 Aug 2007, 8:04 AM
#257
imm avatar

imm

New Zenner

Join Date:
Aug 2007
Posts:
29
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

For some reazon E cannot Delete Variant's in stock by attribute latest version

The page asking for confirmation appears, and I press YES to confirm, when it returns to first page the variation is still there

The only remedy for my is to go to phpmyadmin and delete it directly from the DB table.
Using:

Zen Cart 1.3.7.1
Database Patch Level: 1.3.7.1
One Attribut per product
and IE. 7.0

Any ideas?

27 Aug 2007, 3:38 PM
#258
poosk avatar

poosk

Totally Zenned

Join Date:
Mar 2005
Location:
Helsinki
Posts:
477
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

Sorry if this is asked before. I tried but couldnt find any answer.. So I'd need to automatically remove attributes (size) from the product page dropdowns if the size is soldout... or atleast display sold out if attribute is out of stock.
is it possible?

27 Aug 2007, 10:43 PM
#259
tbrides avatar

tbrides

Zen Follower

Join Date:
Oct 2006
Posts:
198
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

hi,

that is only possible if you have one attribute on a product. it will not work if its more than one.
there's a solution somewhere.

I've heard that attributes will be sorted in v 1.4

3 Sep 2007, 10:00 AM
#260
poosk avatar

poosk

Totally Zenned

Join Date:
Mar 2005
Location:
Helsinki
Posts:
477
Plugin Contributions:
0

Re: Stock by Attribute v4.0 addon for v1.3.5-1.3.9

tbrides:

Hello,

I've a solution for adding Sold Out on the attribute if the stock of it is 0.
It works for dropdown boxes, radio buttons and checkboxes.

I've modified kuroi's attributes.php file, adding the suggestions of other people and figuring it out for dropdowns.

  • First you need to add this to:
    includes\languages\english\custom\product_info.php

if product_info.php is not there it will be in
includes\languages\english\product_info.php

Once you have added the below move the file to your custom directory

define('TEXT_ATTRIBUTES_NOT_IN_STOCK',' Sold Out');

> 
> 
> - I've changed the function  "function zen_draw_pull_down_menu"      in includes\functions\html_output.php
> 
> 
> ```php
function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
    $field = '<select name="' . zen_output_string($name) . '"';
    $soldout = "";
    if (zen_not_null($parameters)) $field .= ' ' . $parameters;

    $field .= '>' . "\n";

    if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

    for ($i=0, $n=sizeof($values); $i<$n; $i++) {
    /* Added by TB on 16/2/2007 */
    /*need to check if Sold Out occurs in the option tag for the dropdown*/
    if(strpos($values[$i]['text'], "Sold Out")) $soldout = 'class ="red bold"';
    else $soldout = "";
      $field .= '  <option '.$soldout.' value="' . zen_output_string($values[$i]['id']) . '"';
      if ($default == $values[$i]['id']) {
        $field .= ' selected="selected"';
      }

      $field .= '>' . zen_output_string($values[$i]['text'], array('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</option>' . "\n";
    }
    $field .= '</select>' . "\n";

    if ($required == true) $field .= TEXT_FIELD_REQUIRED;

    return $field;
  }
  • Then I modified kuroi's attributes.php file. Located in
    includes\modules\custom\attributes.php.
    See attached. Rename your old one to something like attributes.php-old and upload this one.

  • Then I added the class .red to my stylesheet, which just sets color:red

If anybody cares to try this in a test environment for me after they have installed the stock by attributes module.
Please let me know how it goes. It should work, works for me, but no guarantees.

Ok I've tried this like a million times and can't get it to work..

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/ctr/public_html/store/includes/functions/html_output.php on line 510