Skip to content

Instantly share code, notes, and snippets.

@hakikz
Last active May 1, 2021 02:32
Show Gist options
  • Save hakikz/78e7505db089248751021e0b8612ef8f to your computer and use it in GitHub Desktop.
Save hakikz/78e7505db089248751021e0b8612ef8f to your computer and use it in GitHub Desktop.
Porto Theme [Link on Image Template] Swatch Position Support
ul.products li.product-awq_onimage .add-links {
right: 0 !important;
}
ul.products li.product-awq_onimage .add-links .button {
text-indent: 0 !important;
}
ul.products li.product-col .product-content {
text-align: center;
}
ul.products li.product-col .rating-wrap {
margin: 0 auto .7rem !important;
}
.woo-variation-swatches.wvs-archive-align-left .wvs-archive-variation-wrapper .variable-items-wrapper {
justify-content: center !important;
}
ul.products li.product-awq_onimage .add-links {
justify-content: center;
}
ul.products li.product-col .add-links .yith-wcwl-add-to-wishlist>div, ul.products li.product-col .add-links .quickview {
visibility: visible !important;
}
ul.products li.product-awq_onimage .add-links .button:before {
display: none;
}
<?php
function wvs_porto_swatch_position_support(){
remove_action( 'porto_woocommerce_loop_links_on_image', 'woocommerce_template_loop_add_to_cart' );
remove_action( 'woocommerce_after_shop_loop_item', 'wvs_pro_archive_variation_template', 30 );
remove_action( 'woocommerce_after_shop_loop_item', 'wvs_pro_archive_variation_template', 7 );
add_action( 'porto_woocommerce_before_shop_loop_item_title', 'wvs_pro_archive_variation_template', 10 );
// add_action( 'woocommerce_before_shop_loop_item_title', 'wvs_pro_archive_variation_template', 10 );
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 9 );
}
add_action('init', 'wvs_porto_swatch_position_support');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment