OC WordPress Web Designer
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Add Coupon Exclusion By AttributeAll 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.
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>
<?phpecho ‘</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>
<?phpecho ‘</div><div class=”options_group”>’;
Forum: Fixing WordPress
In reply to: Create a CSS Class That Is Specific To A User RoleRole was added using plugin: User Role Editor
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?
- This reply was modified 8 years, 6 months ago by OC WordPress Web Designer.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Shortcode Product SortingI 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.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Checkout Page LayoutFigured it out. CSS.