Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Location
    France
    Posts
    579
    Plugin Contributions
    8

    Default Trigger an action depending on attribute

    I need to trigger an action based on what attribute is selected by the customer and in most cases code such as this works

    if (strpos($options_menu[$i], 'name="id[1]"') !== false) {
    TRIGGER ACTION
    }

    However, if the attribute is one with images it doesn't work

    I set this as a test and it ALWAYS returns FALSE if the attribute has images

    if (strpos($options_menu[$i], 'name="id[26]"') !== false) {
    echo "TRUE";
    }else{
    echo "FALSE";
    }

    Any ideas why this doesn't work on attributes with images? It's got me stumped.

  2. #2
    Join Date
    Nov 2005
    Location
    France
    Posts
    579
    Plugin Contributions
    8

    Default Re: Trigger an action depending on attribute

    I did some more testing and if I do

    print_r ($options_menu);

    the data printed DOES NOT contain any of the attribute info that has images which suggests they are not built in that array

    So if they are not in $options_menu[$i], where are they?

  3. #3
    Join Date
    Nov 2005
    Location
    France
    Posts
    579
    Plugin Contributions
    8

    Default Re: Trigger an action depending on attribute

    I worked this out.

    Used the following:

    if (strpos($options_attributes_image[$i], 'name="id[26]"') !== false) {

 

 

Similar Threads

  1. v139h Change secondary attribute depending on first attribute
    By liderbug in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 19 May 2012, 03:19 PM
  2. Stock quantity depending on attribute
    By compositeone in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 4 Mar 2008, 05:06 PM
  3. How to make image change depending on attribute selected?
    By canemasters in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 1 Aug 2007, 06:33 PM
  4. How can a second attribute change depending on first attribute chosen?
    By suffrinmick in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 2 Apr 2007, 08:24 AM

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