';
echo '
';
echo '
';
}
public static function aldstore_dropshipping_for_aliexpress_before_loop_content() {
$sidebar_layout = 'full';
$sidebar_isset = wp_get_sidebars_widgets();
$sidebar_id = 'widget-shop';
if ( is_product() ) {
$sidebar_layout = 'left';
$sidebar_id = 'widget-product';
}
if ( empty( $sidebar_isset[ $sidebar_id ] ) ) {
$sidebar_layout = 'full';
}
$main_content_classes = array( 'main-content', 'col-12' );
if ( $sidebar_layout != 'full' ) {
$main_content_classes[] = 'col-xl-9 col-lg-8 has-sidebar';
}
$main_content_classes = apply_filters( 'aldstore_dropshipping_for_aliexpress_class_archive_content', $main_content_classes, $sidebar_layout );
echo '
';
}
public static function aldstore_dropshipping_for_aliexpress_after_loop_content() {
echo '
';
}
public static function aldstore_dropshipping_for_aliexpress_sidebar() {
$sidebar_layout = 'full';
$sidebar_isset = wp_get_sidebars_widgets();
$sidebar_id = 'widget-shop';
if ( is_product() ) {
$sidebar_layout = 'left';
$sidebar_id = 'widget-product';
}
if ( empty( $sidebar_isset[ $sidebar_id ] ) ) {
$sidebar_layout = 'full';
}
$sidebar_classes = array( 'sidebar', 'col-xl-3', 'col-lg-4', 'col-12' );
$sidebar_classes = apply_filters( 'aldstore_dropshipping_for_aliexpress_class_sidebar_content_product', $sidebar_classes, $sidebar_layout, $sidebar_id );
if ( $sidebar_layout != "full" ): ?>
';
}
public static function aldstore_dropshipping_for_aliexpress_before_main_content_left() {
global $product;
$product_payment = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_product_payment' );
$classes = 'no-gallery';
$attachment_ids = $product->get_gallery_image_ids();
if ( $attachment_ids && has_post_thumbnail() ) {
$classes = 'has-gallery';
}
$classes .= ' vertical_thumbnail';
if ( ! empty( $product_payment ) ) {
$classes .= ' has_payment';
}
echo '
';
}
public static function aldstore_dropshipping_for_aliexpress_after_main_content_left() {
echo '
';
}
public static function aldstore_dropshipping_for_aliexpress_after_single_product_summary_1() {
echo '
';
}
public static function aldstore_dropshipping_for_aliexpress_after_single_product_summary_2() {
echo '
';
}
public static function aldstore_dropshipping_for_aliexpress_single_product_share_button() {
$enable_product_shares = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_enable_product_shares' );
if ( ! empty( $enable_product_shares ) ) {
get_template_part( 'template-parts/share', 'button' );
}
}
public static function aldstore_dropshipping_for_aliexpress_product_related_products_heading() {
return esc_html__( 'May be you like', 'aldstore-dropshipping-for-aliexpress' );
}
//SHOP CONTROL
public static function aldstore_dropshipping_for_aliexpress_shop_filter_button() {
$sidebar_isset = wp_get_sidebars_widgets();
$sidebar_id = 'widget-shop';
?>
$_POST['product_per_page_filter'],
), $_POST['perpage_action_form']
)
);
exit();
}
}
public static function aldstore_dropshipping_for_aliexpress_product_per_page_tmp() {
$perpage = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_product_per_page', '12' );
$parts = parse_url( home_url() );
$current_url = "{$parts['scheme']}://{$parts['host']}" . add_query_arg( null, null );
$product_per_page_option = array( 12, 18, 24, 30, 36 );
?>
max_num_pages > 1 ) {
?>
'product_cat',
'hide_empty' => true,
);
if ( is_product_category() ) {
$term = get_queried_object();
$args['parent'] = $term->term_id;
} else {
$args['parent'] = 0;
}
$categories = get_terms( $args );
if ( ! empty( $categories ) && ! is_wp_error( $categories ) ) { ?>
term_id, 'thumbnail_id', true );
if ( ! empty( wp_get_attachment_image( $thumbnail_id, 'full' ) ) ) {
echo wp_get_attachment_image( $thumbnail_id, 'full' );
} else { ?>
name ); ?>
get_image_id();
if ( $image_id ) {
$image_url = wp_get_attachment_image_url( $image_id, 'woocommerce_thumbnail' );
} else {
$image_url = wc_placeholder_img_src( 'woocommerce_thumbnail' );
}
?>
get_name() ) . '">'; ?>
is_in_stock() ) {
$postdate = get_the_time( 'Y-m-d' );
$postdatestamp = strtotime( $postdate );
$newness = Aldstore_Dropshipping_For_Aliexpress::aldstore_dropshipping_for_aliexpress_get_option( 'aldstore_dropshipping_for_aliexpress_product_newness', 7 );
if ( ( time() - ( 60 * 60 * 24 * $newness ) ) < $postdatestamp ) :
echo apply_filters( 'woocommerce_new_flash', '
' . esc_html__( 'New', 'aldstore-dropshipping-for-aliexpress' ) . '', $post, $product );
endif;
}
}
public static function aldstore_dropshipping_for_aliexpress_custom_sale_flash() {
global $product;
$percent = '';
if ( $product->is_on_sale() && $product->is_in_stock() ) {
if ( $product->is_type( 'variable' ) ) {
$available_variations = $product->get_available_variations();
$maximumper = 0;
$minimumper = 0;
$percentage = 0;
for ( $i = 0; $i < count( $available_variations ); ++ $i ) {
$variation_id = $available_variations[ $i ]['variation_id'];
$variable_product1 = new WC_Product_Variation( $variation_id );
$regular_price = $variable_product1->get_regular_price();
$sales_price = $variable_product1->get_sale_price();
if ( $regular_price > 0 && $sales_price > 0 ) {
$percentage = round( ( ( ( $regular_price - $sales_price ) / $regular_price ) * 100 ), 0 );
}
if ( $minimumper == 0 ) {
$minimumper = $percentage;
}
if ( $percentage > $maximumper ) {
$maximumper = $percentage;
}
if ( $percentage < $minimumper ) {
$minimumper = $percentage;
}
}
if ( $minimumper == $maximumper ) {
$percent .= $minimumper . '%';
} else {
$percent .= '(' . $minimumper . '-' . $maximumper . ')%';
}
} else {
if ( $product->get_regular_price() > 0 && $product->get_sale_price() > 0 ) {
$percentage = round( ( ( ( $product->get_regular_price() - $product->get_sale_price() ) / $product->get_regular_price() ) * 100 ), 0 );
$percent .= $percentage . '%';
}
}
}
if ( $percent != '' ) {
return '
' . $percent . ' ' . esc_html__( 'Off', 'aldstore-dropshipping-for-aliexpress' ) . '';
}
return '';
}
public static function aldstore_dropshipping_for_aliexpress_group_flash() {
?>
';
}
public static function aldstore_dropshipping_for_aliexpress_checkout_after_order_review() {
echo '
';
}
//REVERSE PRICE
public static function aldstore_dropshipping_for_aliexpress_reverse_price_html( $price, $product ) {
if ( $product->is_on_sale() && ! $product->is_type( 'grouped' ) ) {
$regular_price = wc_price( $product->get_regular_price() );
$sale_price = wc_price( $product->get_sale_price() );
if ( $product->is_type( 'variable' ) ) {
$regular_price = wc_price( $product->get_variation_regular_price( 'min' ) );
$sale_price = wc_price( $product->get_variation_sale_price( 'min' ) );
}
$price = '' . $html . '
';
}
}
return '';
}
//CUSTOM PRODUCT CATEGORY
public static function aldstore_dropshipping_for_aliexpress_template_loop_product_category() {
global $product;
$terms = get_the_terms( $product->get_id(), 'product_cat' );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
$first_category = $terms[0];
$category_link = get_term_link( $first_category );
echo '