Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress + Foxycart

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26068
    brent
    Member

    OK, here’s another question for you guys:

    I’m, basically, trying to combine these two bits of code:

    Code:
    ID, “product-size”, false);
    if(!empty($productSize)) {
    print ‘‘;
    print ‘‘;
    print ‘

    ‘;
    }
    ?>

    and

    Code:
    ID, ‘dropdown-product-option’, false);
    if ($allOptions) {
    echo “;
    foreach ($allOptions as $option) {
    $fullValue = explode(“|”, $option);
    $optionName = $fullValue[0];
    $optionName = $fullValue[1];
    echo ““; }
    echo ““;
    } else {
    echo “

    $productCode   $$price

    “;
    }}
    ?>

    The second one may be familiar, since Chris used it (assuming I typed it correctly) in one of his screencasts.

    What I need to do is have the size of the product affect the price of the product. And I would like to do it the same way that Chris did: using a | to delineate the second part of the custom field and the php splitting the custom field at that marker and sending the second half as a option modifier that raises (or lowers) the price.

    My custom fields are labeled according to the first set of code.

    Does any of this make sense to anyone?

    Can anyone help?

    #63839
    brent
    Member

    OK, I’ve banged my head against the wall a few hundred times and I came up with this:

    Code:
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.