Forum Replies Created

Viewing 15 replies - 1 through 15 (of 198 total)
  • Thread Starter wpress2010

    (@wpress2010)

    I don.t see any way to insert a graphic here to illustrate. But maybe this will help to explain. Here is a virtual product with 2 variables for the user to select from, “Membership type” and “Matching Gift”.

    [wp_cart_button name=”Individual Membership” price=”25.00″ var1=”Membership type|Renewal|New” var2=”Matching Gift?**|No|Yes”]

    I want to allow the user to select a quantity as well, like this:

    var3=”Quantity|1|2|3|4″

    But I don’t think the plug will recognize the quantity chosen and calculate the total for the quantity ordered from that – although it will display the dropdown just fine.

    Thread Starter wpress2010

    (@wpress2010)

    Solved: without too much extra work, I just decided to use the home page class to style the link, avoiding the whole “active” issue:

    body.home li#menu-item-231 a {
    color:red !important

    It’s difficult sometimes when taking over a site that hasn’t been touched in a long time, to make a few significant changes without having to essentially rewrite the whole thing. It would be nice to be able to add a custom class or id to a Custom Link menu item in the WP menu system.

    • This reply was modified 2 months, 1 week ago by wpress2010. Reason: typo
    Thread Starter wpress2010

    (@wpress2010)

    Yes, but here is what caused the red color:

    Originally, the conditional was intended to show one

    • element if a field existed, a different one if it didn’t, and then end the list:

      [if mlsid]

    • MLSID: {@mlsid}
    • [else]<li style=”list-style-type:none; padding:0; line-height:.5″> 
      [/if]

      While this worked, it threw the error. I changed it to this, and the red color went away:

      [if mlsid]

    • MLSID: {@mlsid}
    • [else]<li style=”list-style-type:none; padding:0; line-height:.5″> 
      [/if]

      So, the closing tag of the

      needed to be outside the conditional statements. I am not sure why the first version did not work, as the if/else just presents one bunch of code instead of another, depending on whether the condition is met. Either way, the
      is properly closed by

    .

    Thread Starter wpress2010

    (@wpress2010)

    Thanks, I guess it was no surprise that the Divi team didn’t know much about this. Divi does have some conditional module ability, but none of it relates to anything like the Pods coding. I was able to accomplish what I needed with Pods and CSS. I just used an [if] [else] statement to render different content if the returns were null.

    I had not noticed when Pods apparently added the [else] feature.

    It works perfectly, but the coding automatically turns some unrelated elements further down in the template a red color as if there were an HTML error, but there is not.

    Thread Starter wpress2010

    (@wpress2010)

    Thanks, I realize that. I am just trying to figure out the logic when the Pods conditionals return “nothing”.

    Thread Starter wpress2010

    (@wpress2010)

    Yes, this is very simple to do. I found that the best way to implement EDD within my Divi theme is like this:

    1.) Use Divi code module, put in code for sample mp3 file – which also calls the audio player. Good built-in support for styling author/title/album.

    2.) Use a separate Divi code module to put in the code for the “Purchase” (i.e., add to cart button) file – i.e., the complete mp3 file.

    Bu using separate Divi code modules, position of both Purchase button and player can be tweaked for all mobile platforms as well. Basic idea is to have a row <div> with 2 columns: one of about 80% width for audio player, second one of about 20% width for Purchase button.

    Thread Starter wpress2010

    (@wpress2010)

    Thanks. This works perfectly! I think that the Purchase buttons could be (1) made smaller – simple via CSS, and (2) for space-saving concerns, these buttons should be floated to the right of the audio player. Basically, there are 8 tracks to be offered, so moving the buttons to the same line as the player would help. Still working on that…

    Thread Starter wpress2010

    (@wpress2010)

    Thanks, I get it now. The UI does allow me to drag/drop cells within rows.

    Thread Starter wpress2010

    (@wpress2010)

    Thank you! I came up with this code and it works perfectly (the proxy code is set to “tomato”):

    function custom_proxy_validation($result,$tag){
            $type = $tag['type'];
            $name = $tag['name'];
            if($name == 'proxynumber'){
               $proxyNumber = isset( $_POST['proxynumber'] ) ? trim( $_POST['proxynumber'] ) : '';
    										
                $the_value = preg_match("/tomato/",$_POST[$name]);
                if($proxyNumber == "" || $the_value == false ){ 
                    $result->invalidate( $tag, "please enter valid proxy number" );
                }
            }
            return $result;
        }
        add_filter('wpcf7_validate_text','custom_proxy_validation', 10, 2);
        add_filter('wpcf7_validate_text*', 'custom_proxy_validation', 10, 2);
    Thread Starter wpress2010

    (@wpress2010)

    Thanks, Jory. I checked it again, and it indeed is working as I described.
    In my particular test, there are 8 Properties that have the Catgeory of ‘HB’ and of those 8, only 3 also have the Category of ‘For Sale’ The code returns just the 3.

    I did have a look at WP Query, and it seems pretty straightforward.

    Thread Starter wpress2010

    (@wpress2010)

    After a bit more experimentation, I find that the following code works for my exact purposes:

    [pods name=”property” where=”category.name= ‘HB’ AND where=”category.name= ‘For Sale’ ” template=”HB For Sale” orderby=”post_date DESC”]

    I don’t think that this is in any way an unusual or complicated query. Still thinking about why this strategy works – where others that seemed pretty much the same thing – don’t.

    Thread Starter wpress2010

    (@wpress2010)

    Thank you. I think that there is perhaps some kind of problem with my thinking here. If this were an ordinary SQL query, it would be expressed something like this:

    SELECT *
    FROM property
    WHERE (category = ‘HB’ AND category <> ‘Sold’)

    I haven’t gone into the db to look at the tables. It seems as though the basic problem is that a Pod can have more than one category assigned to it.

    Thread Starter wpress2010

    (@wpress2010)

    Thank you.

    The logic is: a Pod can belong to many categories. I want to display those that are simultaneously in the category of ‘HB’ but also are NOT in the category of ‘Sold’

    So, f’rinstance, there are 6 Pods who have the category of ‘HB’

    Of these 6 Pods, only 3 do NOT also have the category of ‘Sold’

    So, I want to display those 3 only.

    Thread Starter wpress2010

    (@wpress2010)

    Thank you. I tried this statement, and it does not correctly recognize the NOT IN category part of the code.

    Here’s the way it is set up:

    The Pods can have multiple categories. So, as an example, a Pod is in the categories ‘HB’ ‘other’ and ‘different’. So the statement should NOT return this Pod in the results. But it does.

    Code:

    [pods name=”property” where=”category.name IN ( ‘HB’ ) AND category.name NOT IN ( ‘Sold’ )” template=”HB For Sale” orderby=”post_date DESC”]

    Thread Starter wpress2010

    (@wpress2010)

    Thank you! I had looked around in the Pods documentation for a while and did not find this type of conditional statement.

    Is it similarly possible to combine this logic using AND:

    where=”category.name IN( ‘HB’, ‘other’ )” AND where!=”category.name IN( ‘different’ )”

Viewing 15 replies - 1 through 15 (of 198 total)