I would prefer to edit the WooCommerce Current Merchandise Shortcode in order that it change hyperlink merchandise by private hyperlink. I am undecided how to try this.
my private hyperlink is:
$mid_var = get_post_meta($prd_id, 'digi','true') ) {
if(isset($mid_var) && !empty($mid_var)) { get_post_meta ($prd_id, 'digi','ture');
$dig1= "https://stat.co";
$dig_link= "https://www.digi.com".$mid_var;
$dig2= base64_encode( $dig_link );
$aff_link= $dig1.$dig2; }
Right here is the code for the shortcode:
/**
* Current Merchandise shortcode
*
* @param array $atts
* @return string
*/
public static operate recent_products( $atts ) {
world $woocommerce_loop;
$atts = shortcode_atts( array(
'per_page' => '12',
'columns' => '4',
'orderby' => 'date',
'order' => 'desc'
), $atts );
$meta_query = WC()->query->get_meta_query();
$args = array(
'post_type' => 'product',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'posts_per_page' => $atts['per_page'],
'orderby' => $atts['orderby'],
'order' => $atts['order'],
'meta_query' => $meta_query
);
ob_start();
$merchandise = new WP_Query( apply_filters( 'woocommerce_shortcode_products_query', $args, $atts ) );
$columns = absint( $atts['columns'] );
$woocommerce_loop['columns'] = $columns;
if ( $products->have_posts() ) : ?>
<?php woocommerce_product_loop_start(); ?>
<?php whereas ( $products->have_posts() ) : $products->the_post(); ?>
<?php wc_get_template_part( 'content material', 'product' ); ?>
<?php endwhile; // finish of the loop. ?>
<?php woocommerce_product_loop_end(); ?>
<?php endif;
wp_reset_postdata();
return '<div class="woocommerce columns-' . $columns . '">' . ob_get_clean() . '</div>';
}
I’m pondering that I have to someway retrieve the merchandise hyperlink for the posts within the loop
These steps are out of my skill.