Forum Replies Created

Viewing 5 replies - 46 through 50 (of 50 total)
  • Thread Starter OC WordPress Web Designer

    (@oc-wordpress-web-designer)

    All my products are variable products, but I have ALOT of variations so there are like 10 different priced variations with the color black for each product.

    https://beachcandyswimwear.com/shop/swimwear/triangle-bikini-top/?attribute_pa_color=olive&attribute_pa_candy=no-candy&attribute_pa_pads=no-pads

    I was hoping to duplicate the coupon category exclude and switch for attributes in the class-wc-meta-box-coupon-data.php.

    Is that possible?

    // Exclude Categories
    ?>
    <p class=”form-field”><label for=”exclude_product_categories”><?php _e( ‘Exclude categories’, ‘woocommerce’ ); ?></label>
    <select id=”exclude_product_categories” name=”exclude_product_categories[]” style=”width: 50%;” class=”wc-enhanced-select” multiple=”multiple” data-placeholder=”<?php esc_attr_e( ‘No categories’, ‘woocommerce’ ); ?>”>
    <?php
    $category_ids = $coupon->get_excluded_product_categories();
    $categories = get_terms( ‘product_cat’, ‘orderby=name&hide_empty=0’ );

    if ( $categories ) {
    foreach ( $categories as $cat ) {
    echo ‘<option value=”‘ . esc_attr( $cat->term_id ) . ‘”‘ . selected( in_array( $cat->term_id, $category_ids ), true, false ) . ‘>’ . esc_html( $cat->name ) . ‘</option>’;
    }
    }
    ?>
    </select> <?php echo wc_help_tip( __( ‘Product categories that the coupon will not be applied to, or that cannot be in the cart in order for the “Fixed cart discount” to be applied.’, ‘woocommerce’ ) ); ?></p>
    <?php

    echo ‘</div><div class=”options_group”>’;

    ——

    Then add below to class-wc-coupon.php but for the attributes created above.

    // Exclude Categories
    ?>
    <p class=”form-field”><label for=”exclude_product_categories”><?php _e( ‘Exclude categories’, ‘woocommerce’ ); ?></label>
    <select id=”exclude_product_categories” name=”exclude_product_categories[]” style=”width: 50%;” class=”wc-enhanced-select” multiple=”multiple” data-placeholder=”<?php esc_attr_e( ‘No categories’, ‘woocommerce’ ); ?>”>
    <?php
    $category_ids = $coupon->get_excluded_product_categories();
    $categories = get_terms( ‘product_cat’, ‘orderby=name&hide_empty=0’ );

    if ( $categories ) {
    foreach ( $categories as $cat ) {
    echo ‘<option value=”‘ . esc_attr( $cat->term_id ) . ‘”‘ . selected( in_array( $cat->term_id, $category_ids ), true, false ) . ‘>’ . esc_html( $cat->name ) . ‘</option>’;
    }
    }
    ?>
    </select> <?php echo wc_help_tip( __( ‘Product categories that the coupon will not be applied to, or that cannot be in the cart in order for the “Fixed cart discount” to be applied.’, ‘woocommerce’ ) ); ?></p>
    <?php

    echo ‘</div><div class=”options_group”>’;

    Thread Starter OC WordPress Web Designer

    (@oc-wordpress-web-designer)

    Role was added using plugin: User Role Editor

    Thread Starter OC WordPress Web Designer

    (@oc-wordpress-web-designer)

    Installed the plugin, went to the homepage, clicked in Public Access – Restrict Access by User Role – Clicked Customer.

    Custom Redirect to another page filled in. Saved page.

    It redirects when signed in as a customer, but also redirect when not signed in at all which is not wanted.

    Customer has “read” permissions.

    How do I make it not redirect non-logged in users?

    Thread Starter OC WordPress Web Designer

    (@oc-wordpress-web-designer)

    I believe the concept is possible. For example, https://printmorespendless.com/allcal/product/p-touch/tze-111/ has a list of related products that are called by a woocommerce category shortcode.

    However, if you add to the url ?orderby=random (which is done when choosing a random products filter option on a category page) ….. https://printmorespendless.com/allcal/product/p-touch/tze-111/?orderby=random

    the shortcode products are randomly sorted.

    Thread Starter OC WordPress Web Designer

    (@oc-wordpress-web-designer)

    Figured it out. CSS.

Viewing 5 replies - 46 through 50 (of 50 total)