• I am aware that content egg allows users to customize the text in the external link button by using values like %MERCH% and %DOMAIN% in the general settings.

    However, I’d like to ask if there’s a Shortcode or a PHP function that would allow the merchant name of the woo synchronization product to be displayed before the default ‘buy product’ button. I couldn’t find any shortcodes so I tried writing a function

    use ContentEgg\application\helpers\TemplateHelper;
    
    add_action( 'woocommerce_before_add_to_cart_form', 'add_merchant_before_add_to_cart_form' );
     
    function add_merchant_before_add_to_cart_form(){
    	$merchantInfo = '<img src="<?php echo esc_attr(TemplateHelper::getMerhantIconUrl($item, true)); ?>" /> <small class="title-case"><?php TemplateHelper::getMerhantName($item, true); ?></small>';
        
        return $merchantInfo;
    }
    

    It’s incorrect but it explains what I am trying to do. I’d appreciate it if someone could help. Thanks.

  • The topic ‘Customize buy now button with merchant name’ is closed to new replies.