Page 225 of 356 FirstFirst ... 125175215223224225226227235275325 ... LastLast
Results 2,241 to 2,250 of 3558
  1. #2241
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

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

    Well, nother recent "discovery" between what dalia has pointed out and some further code inspection, the tags around the dropdowns need to be modified and that should "help". Otherwise would suggest deling with the .css to modify the appearance.

    I'll see if I can suggest something based on the information previously provided.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #2242
    Join Date
    Dec 2013
    Location
    Maine
    Posts
    77
    Plugin Contributions
    0

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

    Ok, I'm using an older version of SBA 1.53 and some of the "Out of Stock" messages are grey and some of them are black. I can't for the life of me find anywhere it sets a color for the text in a dropdown. Do you know where it is, mc12345678?

    Mal

  3. #2243
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,556
    Plugin Contributions
    28

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

    Quote Originally Posted by Malaperth View Post
    Ok, I'm using an older version of SBA 1.53 and some of the "Out of Stock" messages are grey and some of them are black. I can't for the life of me find anywhere it sets a color for the text in a dropdown. Do you know where it is, mc12345678?

    Mal
    What is your url with a gray and a black message?

  4. #2244
    Join Date
    Dec 2013
    Location
    Maine
    Posts
    77
    Plugin Contributions
    0

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

    The site owner had me remove all the 'out of stock' items so at the moment due to a couple orders after a site 'restock', there are only black messages. It must have been something I changed long ago and am too senile to remember! ;)

    Mal

  5. #2245
    Join Date
    Dec 2013
    Location
    Maine
    Posts
    77
    Plugin Contributions
    0

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

    Code:
    		if($products_options->fields['products_quantity'] > 0){
    								$PWA_STOCK_QTY = PWA_STOCK_QTY . $products_options->fields['products_quantity'] . ' ';
    							}
    							else{
    								$products_options->fields['products_options_values_name'] = PWA_OUT_OF_STOCK . $products_options->fields['products_options_values_name'];
    							}

    I know more about nuclear physics (which is nothing) than I do about databases and am embarrassed to essentially be asking for someone to write code for me, but basically what I want to happen is that if there are items available, complete the if statement, but if the stock is 0, change the code in red so it removes that entire attribute from the database. Anyone care to help a senile old fart, or point me in a direction so I can figure it out by myself? I've been looking for sections of code that do that, but can't seem to find any (again, I'm using a very old version of 1.53 of SBA).

    Mal

  6. #2246
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

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

    Quote Originally Posted by Malaperth View Post
    but basically what I want to happen is that if there are items available, complete the if statement, but if the stock is 0, change the code in red so it removes that entire attribute from the database. Anyone care to help a senile old fart, or point me in a direction so I can figure it out by myself? l
    What you are trying to do here is not exactly an "easy" task.

    About the best I can do with the time available to me is direct you to how the SBA module itself does this. In simple terms, the SAB page/code itself
    /admin/products_with_attributes_stock.php creates links to the attribute to be deleted.

    These links read like:
    <a href="http://yourdomain.com/youradmin/products_with_attributes_stock.php?action=delete&products_id=1234&attributes=543 21">Delete Variant</a>

    So in theory, it is a matter of determining the products_id and the attributes value from the page where your code is found, inserting these into this URL and then having your code load the /products_with_attributes_stock.php page.

    In practice this isn't going to work though, firstly because this is admin related code it won't work from the store front unless you are a logged in admin.
    Secondly, if you could run this code from the location indicated it would take the customer away from thier current page to the attributes deletion code, and you'll then need some way to direct them back to where they were, so as I say, this method won't work.

    Now having said that, the /products_with_attributes_stock.php code itself has everything that is needed to safely perform these deletions, so you could copy the relevant part of the code and create a 'function' from it specifically for this task, and that will overcome the problems I've just mentioned.

    Your code snippet could then be coded something like:

    Code:
     if($products_options->fields['products_quantity'] > 0){                                $PWA_STOCK_QTY = PWA_STOCK_QTY . $products_options->fields['products_quantity'] . ' ';
                                }
                                else{
     my_delete_function($productID, $arributeValue) ;  
    
    
                                }
    Now having said that, do you *really* want the attributed product deleted, or are you happy for them to simply not been shown to the customer?

    Although difficult to say without testing/checking, if you are happy to just have them not be shown, you could probably just comment out your line
    that reads
    $products_options->fields['products_options_values_name'] = PWA_OUT_OF_STOCK . $products_options->fields['products_options_values_name'];

    and the out of stock item(s) won't appear in the list.

    At least that's the theory.

    Cheers
    RodG

  7. #2247
    Join Date
    Dec 2013
    Location
    Maine
    Posts
    77
    Plugin Contributions
    0

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

    Thanks, RodG! A direction I asked for and a direction I got! Can't ask for much more than that! And, if I can't figure out how to actually delete it, the customer will never know it isn't deleted if she doesn't see it... ;)

    Mal

  8. #2248
    Join Date
    Dec 2013
    Location
    Maine
    Posts
    77
    Plugin Contributions
    0

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

    Quote Originally Posted by jeking View Post
    What is your url with a gray and a black message?
    Jeking, go to sweetsagescents.com, click on the Wax Tarts category and check out the dropdown on the product ***SALE, SALE, SALE*** Sale Scent Shots. The first out of stock is in black type, the rest are 'greyed out'. At this point, I don't have the time to do any debugging or even look at the tools that are available in Firefox, but at least now you can see what I mean and that I'm not crazy (well, not for that reason anyway... ;) ).

    Mal

  9. #2249
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

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

    Quote Originally Posted by Malaperth View Post
    Jeking, go to sweetsagescents.com, click on the Wax Tarts category and check out the dropdown on the product ***SALE, SALE, SALE*** Sale Scent Shots. The first out of stock is in black type, the rest are 'greyed out'. At this point, I don't have the time to do any debugging or even look at the tools that are available in Firefox, but at least now you can see what I mean and that I'm not crazy (well, not for that reason anyway... ;) ).

    Mal
    Answer is that the single dropdown (single attribute) code incorporates disabling of out-of-stock items (this was code implemented to the SBA dropdown attribute type. If not mistaken if the attribute type for products such as this is instead chosen as a standard dropdown, then the greying will not occur.

    For multiple attributes, (two or more dropdowns), something like this is in the works for incorporation, but is expected to involve admin controllable options because of the potential complexity of ways to be presented.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  10. #2250
    Join Date
    Dec 2013
    Location
    Maine
    Posts
    77
    Plugin Contributions
    0

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

    Quote Originally Posted by mc12345678 View Post
    Answer is that the single dropdown (single attribute) code incorporates disabling of out-of-stock items (this was code implemented to the SBA dropdown attribute type. If not mistaken if the attribute type for products such as this is instead chosen as a standard dropdown, then the greying will not occur.

    For multiple attributes, (two or more dropdowns), something like this is in the works for incorporation, but is expected to involve admin controllable options because of the potential complexity of ways to be presented.
    Well, I have not been able to find the admin 'command' or whatever you wish to call it for simply not showing out of stock items, and when creating the attribute, I change nothing as far as the select itself, I just add the attribute name and insert it, then add values. My issue is that something seems to be following two code paths (which I easily could have screwed up myself by editing the wrong thing or doing it the wrong way long ago) since some come out black and some grey.

    Mal

 

 

Similar Threads

  1. Problems with addon: Dynamic Drop Downs for Stock By Attribute
    By Dunk in forum All Other Contributions/Addons
    Replies: 56
    Last Post: 30 Apr 2014, 07:55 PM
  2. MySQL Problem with Product with Attribute Stock addon
    By rtwingfield in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Sep 2011, 03:35 PM
  3. Hide Zero Quantity Attributes with attribute-stock addon
    By leevil123 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 11 Feb 2010, 05:06 PM
  4. Replies: 4
    Last Post: 22 Jan 2010, 10:43 PM
  5. Price Products in the grid by 'Stock by Attribute' addon?
    By Salixia in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Oct 2009, 06:03 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