Search
 
SCRIPT & CODE EXAMPLE
 

PHP

if product open display this button

add_action( 'woocommerce_single_product_summary', 'custom_button_by_categories', 32 ,0 );
function custom_button_by_categories(){
    
    global $product;

    // Define your categories in this array (can be Ids, slugs or names)
    $product_cats = array('clothing', 'music', 'furnitures');

    if( has_term( $product_cats, 'product_cat', $product->get_id() ) ){
         $demo_url = get_post_meta( $product->get_id(), 'demo_url', true );
         echo '<a class="fancybox iframe" data-width="1280" data-height="720" href="'.$demo_url.'"><button style="background: lightblue; padding-left: 19px; padding-right: 19px;">Przymierz</button></a>';
    }
}
Comment

if product open display this button

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30, 0);
Comment

PREVIOUS NEXT
Code Example
Php :: multipart json test laravel 
Php :: run multiple php scripts parallel 
Php :: Rewrite .php file without .php extension with .htaccess ULTIMATE SOLUTION 
Php :: php browser cache clear 
Php :: ErrorException Undefined index(laravel 7 array helpers) 
Php :: seeder name singular or plural laravel 
Php :: check file extension in php 
Php :: codeigniter query Profiling - To enable the profiler 
Php :: jquery media validation 
Php :: not have permision elgg settings.php 
Php :: Insert Data using modal 
Php :: How to display limited post content in WordPress 
Php :: Lavavel nova toggle 
Php :: how do istart writing a php code 
Php :: laravel where has relation 
Php :: how to write a php program for an electricity bill using if-else conditions 
Php :: Laravel You may use the sectionMissing directive to determine if a section does not have content: 
Php :: overwrite existing key value pair php 
Php :: how to upload images to sql database php PDO 
Php :: login php 
Php :: php multiple array to single array 
Php :: laravel 6 migration add column to existing table 
Php :: doctrine findby criteria 
Php :: how to increment date in php 
Php :: phpstorm deployment 
Java :: java get screen size 
Java :: bukkit scoreboard 
Java :: regex java email validation 
Java :: change font size java swing 
Java :: Card view implement 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =