wprock
Forum Replies Created
-
Try swatches plugin.
Forum: Plugins
In reply to: [WooCommerce] Add custom field while adding customerYou can do this
update_user_meta( $customer_id, 'YOURCUSTOMFIELDKEY',YOURCUSTOMFIELDDATA);Forum: Plugins
In reply to: [WooCommerce] Not the Description tab, but the Details tabHow are you getting Details tab? Are you using the plugin or custom code for custom tabs? Can you share your site URL?
Forum: Plugins
In reply to: [WooCommerce] WooCommerce “Sale!” sticker has disappeared!Try this once
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly global $post, $product; if ( ! $product->is_in_stock() ) return; $sale_price = get_post_meta( $product->id, '_price', true); $regular_price = get_post_meta( $product->id, '_regular_price', true); if ( empty( $regular_price ) ) { //then this is a variable product //LINE BELOW CAUSING FATAL ERROR ON SEARCH PAGES $available_variations = $product->get_available_variations(); $variation_id=$available_variations[0]['variation_id']; $variation= new WC_Product_Variation( $variation_id ); $regular_price = $variation->regular_price; $sale_price = $variation->sale_price; } $sale = ceil(( ($regular_price - $sale_price) / $regular_price ) * 100); if ( !empty( $regular_price ) && !empty( $sale_price ) && $regular_price > $sale_price ) : ?> <?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">-' . $sale . '%</span>', $post, $product ); ?> <?php endif;Forum: Plugins
In reply to: [WooCommerce] WooCommerce “Sale!” sticker has disappeared!I am getting the sale badge https://www.sbcskincare.co.uk/product/honey-oats-bath-shower-creme/
Forum: Plugins
In reply to: [WooCommerce] Downloads are not workingYou should hire a developer for this issue.This is my opinion.
Forum: Plugins
In reply to: [WooCommerce] Inaccessible order pageWhat kind of errors are you getting? Are you logged in as administrator and navigate to Dashboard -> WooCommerce -> Orders page?
Forum: Plugins
In reply to: [WooCommerce] increasing woocommerce_ajax_variation_threshold breaking pageLooks like there have problems in coding or product variations settings
Forum: Plugins
In reply to: [WooCommerce] Use price variable in button “add to cart”Just replace this line
$new_text = $text . __(' for ', 'woocommerce' ) . $price;with
$new_text = __('Buy for', 'woocommerce' ) . ' ' . $price;Forum: Plugins
In reply to: [WooCommerce] restrict product search to product title onlyYou can check this tutorial
Forum: Plugins
In reply to: [WooCommerce] Use price variable in button “add to cart”Here is the snippet:
add_action( 'woocommerce_product_single_add_to_cart_text', 'paulc_change_single_add_to_cart_text', 10, 2 ); function paulc_change_single_add_to_cart_text( $text, $product ) { $price = get_woocommerce_currency_symbol( get_woocommerce_currency() ) . wc_get_price_to_display( $product ); $new_text = $text . __(' for ', 'woocommerce' ) . $price; return $new_text; }Forum: Plugins
In reply to: [WooCommerce] Disable sortable UI for attributesI tried this snippet
add_action( 'admin_footer', function(){ $screen = get_current_screen(); $screen_id = $screen ? $screen->id : ''; if ( ! in_array( $screen_id, array( 'product', 'edit-product' ) ) ) return; ?> <script type="text/javascript"> jQuery( function( $ ) { $( function() { // Attribute ordering. $( '.product_attributes' ).sortable({ items: '.woocommerce_attribute', disabled: true }); $( '.woocommerce_attribute h3 .sort' ).css('cursor', 'pointer'); }); }); </script> <?php }, 999);I added the code into functions.php file
Forum: Plugins
In reply to: [WooCommerce] Some products images not appear on WoocommerceDisable the Shortpixel CDN option or shortpixel plugin and test the shop page.
Forum: Plugins
In reply to: [WooCommerce] Custom text field inputs for attributesYou can try this approach
add_action( 'woocommerce_product_additional_information', 'paulc_custom_field_data', 40 ); function paulc_custom_field_data( $product ) { //* WRITE YOUR PHP CODE HERE }Forum: Plugins
In reply to: [WooCommerce] problem…?I checked your site. You are using the Elementor for shop page. Properly check the widget settings. CSS is conflicting with theme’s CSS