Kod
Taggar:
Alla
FacetWP
Woocommerce
WC: Ta bort betalmetoder från checkout
// Disable all payment gateways on the checkout page
add_filter( 'woocommerce_cart_needs_payment', '__return_false' );
Lightbox popup slider
/*!
* Lightbox v2.11.1
* by Lokesh Dhakar
*
* More info:
* http://lokeshdhakar.com/projects/lightbox2/
*
* Copyright Lokesh Dhakar
* Released under the MIT license
* https://github.com/lokesh/lightbox2/blob/master/LICENSE
*
* @preserve
*/
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.lightbox=b(a.jQuery)}(this,function(a){function b(b){this.album=[],this.currentImageIndex=void 0,this.init(),this.options=a.extend({},this.constructor.defaults),this.option(b)}return b.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:600,fitImagesInViewport:!0,imageFadeDuration:600,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1,sanitizeTitle:!1},b.prototype.option=function(b){a.extend(this.options,b)},b.prototype.imageCountLabel=function(a,b){return this.options.albumLabel.replace(/%1/g,a).replace(/%2/g,b)},b.prototype.init=function(){var b=this;a(document).ready(function(){b.enable(),b.build()})},b.prototype.enable=function(){var b=this;a("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(c){return b.start(a(c.currentTarget)),!1})},b.prototype.build=function(){if(!(a("#lightbox").length>0)){var b=this;a('<div id="lightboxOverlay" tabindex="-1" class="lightboxOverlay"></div><div id="lightbox" tabindex="-1" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt=""/><div class="lb-nav"><a class="lb-prev" aria-label="Previous image" href="" ></a><a class="lb-next" aria-label="Next image" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo(a("body")),this.$lightbox=a("#lightbox"),this.$overlay=a("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.$image=this.$lightbox.find(".lb-image"),this.$nav=this.$lightbox.find(".lb-nav"),this.containerPadding={top:parseInt(this.$container.css("padding-top"),10),right:parseInt(this.$container.css("padding-right"),10),bottom:parseInt(this.$container.css("padding-bottom"),10),left:parseInt(this.$container.css("padding-left"),10)},this.imageBorderWidth={top:parseInt(this.$image.css("border-top-width"),10),right:parseInt(this.$image.css("border-right-width"),10),bottom:parseInt(this.$image.css("border-bottom-width"),10),left:parseInt(this.$image.css("border-left-width"),10)},this.$overlay.hide().on("click",function(){return b.end(),!1}),this.$lightbox.hide().on("click",function(c){"lightbox"===a(c.target).attr("id")&&b.end()}),this.$outerContainer.on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return 0===b.currentImageIndex?b.changeImage(b.album.length-1):b.changeImage(b.currentImageIndex-1),!1}),this.$lightbox.find(".lb-next").on("click",function(){return b.currentImageIndex===b.album.length-1?b.changeImage(0):b.changeImage(b.currentImageIndex+1),!1}),this.$nav.on("mousedown",function(a){3===a.which&&(b.$nav.css("pointer-events","none"),b.$lightbox.one("contextmenu",function(){setTimeout(function(){this.$nav.css("pointer-events","auto")}.bind(b),0)}))}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return b.end(),!1})}},b.prototype.start=function(b){function c(a){d.album.push({alt:a.attr("data-alt"),link:a.attr("href"),title:a.attr("data-title")||a.attr("title")})}var d=this,e=a(window);e.on("resize",a.proxy(this.sizeOverlay,this)),this.sizeOverlay(),this.album=[];var f,g=0,h=b.attr("data-lightbox");if(h){f=a(b.prop("tagName")+'[data-lightbox="'+h+'"]');for(var i=0;i<f.length;i=++i)c(a(f[i])),f[i]===b[0]&&(g=i)}else if("lightbox"===b.attr("rel"))c(b);else{f=a(b.prop("tagName")+'[rel="'+b.attr("rel")+'"]');for(var j=0;j<f.length;j=++j)c(a(f[j])),f[j]===b[0]&&(g=j)}var k=e.scrollTop()+this.options.positionFromTop,l=e.scrollLeft();this.$lightbox.css({top:k+"px",left:l+"px"}).fadeIn(this.options.fadeDuration),this.options.disableScrolling&&a("body").addClass("lb-disable-scrolling"),this.changeImage(g)},b.prototype.changeImage=function(b){var c=this,d=this.album[b].link,e=d.split(".").slice(-1)[0],f=this.$lightbox.find(".lb-image");this.disableKeyboardNav(),this.$overlay.fadeIn(this.options.fadeDuration),a(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating");var g=new Image;g.onload=function(){var h,i,j,k,l,m;f.attr({alt:c.album[b].alt,src:d}),a(g),f.width(g.width),f.height(g.height),m=a(window).width(),l=a(window).height(),k=m-c.containerPadding.left-c.containerPadding.right-c.imageBorderWidth.left-c.imageBorderWidth.right-20,j=l-c.containerPadding.top-c.containerPadding.bottom-c.imageBorderWidth.top-c.imageBorderWidth.bottom-c.options.positionFromTop-70,"svg"===e&&(0!==g.width&&0!==g.height||(f.width(k),f.height(j))),c.options.fitImagesInViewport?(c.options.maxWidth&&c.options.maxWidth<k&&(k=c.options.maxWidth),c.options.maxHeight&&c.options.maxHeight<j&&(j=c.options.maxHeight)):(k=c.options.maxWidth||g.width||k,j=c.options.maxHeight||g.height||j),(g.width>k||g.height>j)&&(g.width/k>g.height/j?(i=k,h=parseInt(g.height/(g.width/i),10),f.width(i),f.height(h)):(h=j,i=parseInt(g.width/(g.height/h),10),f.width(i),f.height(h))),c.sizeContainer(f.width(),f.height())},g.src=this.album[b].link,this.currentImageIndex=b},b.prototype.sizeOverlay=function(){var b=this;setTimeout(function(){b.$overlay.width(a(document).width()).height(a(document).height())},0)},b.prototype.sizeContainer=function(a,b){function c(){d.$lightbox.find(".lb-dataContainer").width(g),d.$lightbox.find(".lb-prevLink").height(h),d.$lightbox.find(".lb-nextLink").height(h),d.$overlay.focus(),d.showImage()}var d=this,e=this.$outerContainer.outerWidth(),f=this.$outerContainer.outerHeight(),g=a+this.containerPadding.left+this.containerPadding.right+this.imageBorderWidth.left+this.imageBorderWidth.right,h=b+this.containerPadding.top+this.containerPadding.bottom+this.imageBorderWidth.top+this.imageBorderWidth.bottom;e!==g||f!==h?this.$outerContainer.animate({width:g,height:h},this.options.resizeDuration,"swing",function(){c()}):c()},b.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide(),this.$lightbox.find(".lb-image").fadeIn(this.options.imageFadeDuration),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},b.prototype.updateNav=function(){var a=!1;try{document.createEvent("TouchEvent"),a=!!this.options.alwaysShowNavOnTouchDevices}catch(a){}this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(a&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),a&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),a&&this.$lightbox.find(".lb-next").css("opacity","1"))))},b.prototype.updateDetails=function(){var a=this;if(void 0!==this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title){var b=this.$lightbox.find(".lb-caption");this.options.sanitizeTitle?b.text(this.album[this.currentImageIndex].title):b.html(this.album[this.currentImageIndex].title),b.fadeIn("fast")}if(this.album.length>1&&this.options.showImageNumberLabel){var c=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find(".lb-number").text(c).fadeIn("fast")}else this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return a.sizeOverlay()})},b.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){(new Image).src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){(new Image).src=this.album[this.currentImageIndex-1].link}},b.prototype.enableKeyboardNav=function(){this.$lightbox.on("keyup.keyboard",a.proxy(this.keyboardAction,this)),this.$overlay.on("keyup.keyboard",a.proxy(this.keyboardAction,this))},b.prototype.disableKeyboardNav=function(){this.$lightbox.off(".keyboard"),this.$overlay.off(".keyboard")},b.prototype.keyboardAction=function(a){var b=a.keyCode;27===b?(a.stopPropagation(),this.end()):37===b?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):39===b&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},b.prototype.end=function(){this.disableKeyboardNav(),a(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),this.options.disableScrolling&&a("body").removeClass("lb-disable-scrolling")},new b});
//# sourceMappingURL=lightbox.min.map
/*!
* Lightbox v2.11.1
* by Lokesh Dhakar
*
* More info:
* http://lokeshdhakar.com/projects/lightbox2/
*
* Copyright Lokesh Dhakar
* Released under the MIT license
* https://github.com/lokesh/lightbox2/blob/master/LICENSE
*
* @preserve
*/
{"version":3,"sources":["../../src/js/lightbox.js"],"names":["root","factory","define","amd","exports","module","require","lightbox","jQuery","this","$","Lightbox","options","album","currentImageIndex","init","extend","constructor","defaults","option","albumLabel","alwaysShowNavOnTouchDevices","fadeDuration","fitImagesInViewport","imageFadeDuration","positionFromTop","resizeDuration","showImageNumberLabel","wrapAround","disableScrolling","sanitizeTitle","prototype","imageCountLabel","currentImageNum","totalImages","replace","self","document","ready","enable","build","on","event","start","currentTarget","length","appendTo","$lightbox","$overlay","$outerContainer","find","$container","$image","$nav","containerPadding","top","parseInt","css","right","bottom","left","imageBorderWidth","hide","end","target","attr","changeImage","which","one","setTimeout","bind","$link","addToAlbum","push","alt","link","title","$window","window","proxy","sizeOverlay","$links","imageNumber","dataLightboxValue","prop","i","j","scrollTop","scrollLeft","fadeIn","addClass","filename","filetype","split","slice","disableKeyboardNav","preloader","Image","onload","imageHeight","imageWidth","maxImageHeight","maxImageWidth","windowHeight","windowWidth","src","width","height","maxWidth","maxHeight","sizeContainer","postResize","newWidth","newHeight","focus","showImage","oldWidth","outerWidth","oldHeight","outerHeight","animate","stop","updateNav","updateDetails","preloadNeighboringImages","enableKeyboardNav","alwaysShowNav","createEvent","e","show","$caption","text","html","labelText","removeClass","keyboardAction","off","keycode","keyCode","stopPropagation","fadeOut"],"mappings":";;;;;;;;;;;;;CAeC,SAAUA,EAAMC,GACS,kBAAXC,SAAyBA,OAAOC,IAEvCD,QAAQ,UAAWD,GACO,gBAAZG,SAIdC,OAAOD,QAAUH,EAAQK,QAAQ,WAGjCN,EAAKO,SAAWN,EAAQD,EAAKQ,SAEnCC,KAAM,SAAUC,GAEhB,QAASC,GAASC,GAChBH,KAAKI,SACLJ,KAAKK,sBAAoB,GACzBL,KAAKM,OAGLN,KAAKG,QAAUF,EAAEM,UAAWP,KAAKQ,YAAYC,UAC7CT,KAAKU,OAAOP,GAmgBd,MA9fAD,GAASO,UACPE,WAAY,iBACZC,6BAA6B,EAC7BC,aAAc,IACdC,qBAAqB,EACrBC,kBAAmB,IAGnBC,gBAAiB,GACjBC,eAAgB,IAChBC,sBAAsB,EACtBC,YAAY,EACZC,kBAAkB,EASlBC,eAAe,GAGjBnB,EAASoB,UAAUZ,OAAS,SAASP,GACnCF,EAAEM,OAAOP,KAAKG,QAASA,IAGzBD,EAASoB,UAAUC,gBAAkB,SAASC,EAAiBC,GAC7D,MAAOzB,MAAKG,QAAQQ,WAAWe,QAAQ,MAAOF,GAAiBE,QAAQ,MAAOD,IAGhFvB,EAASoB,UAAUhB,KA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B,GAAI3H","file":"lightbox.min.js"}//# sourceMappingURL=lightbox.min.map
.lb-loader,.lightbox{text-align:center;line-height:0;position:absolute;left:0}body.lb-disable-scrolling{overflow:hidden}.lightboxOverlay{position:absolute;top:0;left:0;z-index:9999;background-color:#000000;filter:alpha(Opacity=70);opacity:.7;display:none}.lightbox{width:100%;z-index:10000;font-weight:400;outline:0}.lightbox .lb-image{display:block;height:auto;max-width:inherit;max-height:none;border-radius:0px;}.lightbox a img{border:none}.lb-outerContainer{position:relative;width:250px;height:250px;margin:0 auto;border-radius:4px;background-color:#fff}.lb-outerContainer:after{content:"";display:table;clear:both}.lb-loader{top:43%;height:25%;width:100%}.lb-cancel{display:block;width:32px;height:32px;margin:0 auto;background:url(../img/loading.gif) no-repeat}.lb-nav{position:absolute;top:0;left:0;height:100%;width:100%;z-index:10}.lb-container>.nav{left:0}.lb-nav a{outline:0;background-image:url(data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)}.lb-next,.lb-prev{height:100%;cursor:pointer;display:block}.lb-nav a.lb-prev{width:34%;left:0;float:left;background:url(../img/prev.png) left 48% no-repeat;filter:alpha(Opacity=0);opacity:0;-webkit-transition:opacity .6s;-moz-transition:opacity .6s;-o-transition:opacity .6s;transition:opacity .6s}.lb-nav a.lb-prev:hover{filter:alpha(Opacity=100);opacity:1}.lb-nav a.lb-next{width:64%;right:0;float:right;background:url(../img/next.png) right 48% no-repeat;filter:alpha(Opacity=0);opacity:0;-webkit-transition:opacity .6s;-moz-transition:opacity .6s;-o-transition:opacity .6s;transition:opacity .6s}.lb-nav a.lb-next:hover{filter:alpha(Opacity=100);opacity:1}.lb-dataContainer{margin:0 auto;padding-top:5px;width:100%;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.lb-dataContainer:after{content:"";display:table;clear:both}.lb-data{padding:0 4px;color:#ccc}.lb-data .lb-details{width:85%;float:left;text-align:left;line-height:1.1em; color: #fff;}.lb-data .lb-caption{font-size:0.8em;font-weight:400;line-height:1.3}.lb-data .lb-caption a{color:#fff}.lb-data .lb-number{display:block;clear:left;padding: 10px 0 1em;font-size:12px;color:#ffb367}.lb-data .lb-close{display:block;float:right;width:30px;height:30px;background:url(../img/close.png) top right no-repeat;text-align:right;outline:0;filter:alpha(Opacity=70);opacity:.7;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s}.lb-data .lb-close:hover{cursor:pointer;filter:alpha(Opacity=100);opacity:1}
Counter
<?php elseif(get_row_layout() == 'counter'): ?>
<!--- Counter ---->
<section class="counter-section grey-bg pad">
<div class="wrap flex vert-center container">
<div class="col-f-1">
<?php $text = get_sub_field('text_counter');?>
<?php if( $text ): ?>
<div class="counter-header">
<?php echo $text; ?>
</div>
<?php endif; ?>
</div>
<div class="col-f-1 flex flex-space numbers center">
<?php if( have_rows('nummer_text_counter') ): ?>
<?php while( have_rows('nummer_text_counter') ) : the_row(); ?>
<div class="col-1-4">
<?php $nr_value = get_sub_field('nummer'); ?>
<?php $text_value = get_sub_field('text'); ?>
<?php $unit = get_sub_field('enhet', 'options'); ?>
<div class="flex-counter">
<span class="nr count" data-count="<?php echo $nr_value ?>">0</span>
<?php if($unit):?> <span class="unit"><?php echo $unit;?></span><?php endif;?>
</div>
<p class="sub"><?php echo $text_value ?></p>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
</section>
/*------------- Counter ------------*/
.counter-section .nr,
.counter-section .unit {
color: var(--primary);
font-size: var(--font-size-xl);
font-weight: var(--font-weight-bold);
}
.counter-section .sub {
font-size: var(--font-size-xs);
}
//--------------- Counter in Flexible Content
var a = 0;
$(window).scroll(function() {
var oTop = $('.counter-section .flex').offset().top - window.innerHeight;
if (a == 0 && $(window).scrollTop() > oTop) {
$('.count').each(function() {
var $this = $(this),
countTo = $this.attr('data-count');
$({
countNum: $this.text()
}).animate({
countNum: countTo
},{
duration: 3000,
easing: 'swing',
step: function() {
$this.text(Math.floor(this.countNum));
},
complete: function() {
$this.text(this.countNum);
}
});
});
a = 1;
}
});
Lägg till bilder/ikoner i FacetWP
add_filter('facetwp_facet_display_value', function ($label, $params) {
if ('groove' == $params['facet']['name']) { //groove är här namnet på checkbox-facet
$val = $params['row']['facet_value']; //hämta facet-värde (checkboxvärde)
$label = '<img src="/wp-content/themes/seodr/assets/img/{val}.svg" alt="{val}" />'; //matcha facetvärde med bildnamn (som måste vara likadana)
$label = str_replace('{val}', $val, $label);
}
return $label;
}, 10, 2);
/* För woocommerce */
function fwp_wrapper_open() {
if (!is_singular()) : echo '<!-- start facetwp-template --><div class="facetwp-template">'; endif;
}
function fwp_wrapper_close() {
if (!is_singular()) : echo '</div><!-- end facetwp-template -->'; endif;
}
add_action('woocommerce_before_shop_loop', 'fwp_wrapper_open', 5);
add_action('woocommerce_after_shop_loop', 'fwp_wrapper_close', 15);
add_action('woocommerce_no_products_found', 'fwp_wrapper_open', 5);
add_action('woocommerce_no_products_found', 'fwp_wrapper_close', 15);
/* */
Ändra tabbar/flikar i WC
add_filter('woocommerce_product_tabs', 'seodr_new_tabs');
function seodr_new_tabs($tabs) {
unset($tabs['description']);
unset($tabs['reviews']);
unset($tabs['additional_information']);
return $tabs;
}
add_filter('woocommerce_product_tabs', 'seodr_new_tabs');
function seodr_new_tabs($tabs) {
unset($tabs['description']); // ta bort originalflik
/* Lägg till flik igen men med nya värden */
$tabs['description'] = array(
'priority' => 24, //här ändras ordning
);
return $tabs;
}
add_filter('woocommerce_product_tabs', 'seodr_new_tabs');
function seodr_new_tabs($tabs) {
unset($tabs['description']);
$tabs['related_products'] = array(
'title' => __('Related products'), //döpa om flik
'priority' => 24, //bestäm ordning
'callback' => 'rel_new' //ange function-namn för flikinnehåll
);
return $tabs;
}
/* Ta bort gammal output */
remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
remove_action('woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15);
/* */
/* Hämta in output inuti flik */
function rel_new() {
global $product;
$upsells = version_compare(WC_VERSION, '3.0', '<') ? $product->get_upsells() : $product->get_upsell_ids();
if (count($upsells) > 0) {
woocommerce_upsell_display();
} else {
woocommerce_output_related_products();
}
}
add_action('woocommerce_after_single_product_summary', 'rel_new', 20);
add_filter('woocommerce_product_tabs', 'seodr_new_tabs');
function seodr_new_tabs($tabs) {
global $product;
$product_id = $product->get_id();
/* Ange egna fliknamn via ACF-fält, med fallback */
$fliknamn = get_field('fliknamn', $product_id);
if ($fliknamn) : $namnet = $fliknamn;
else : $namnet = __('Dokument');
/* */
/* Lägg till flik om ACF-fält är ifyllt */
if (get_field('dokument', $product_id)) {
$tabs['tab1'] = array(
'title' => $namnet, // namn enl. ovan
'priority' => 27, //bestäm flikordning
'callback' => 'seodr_tabcontent1' //ange function för innehållet
);
}
/* */
return $tabs;
}
/* Innehåll */
function seodr_tabcontent1() {
global $product;
$product_id = $product->get_id();
echo '<div class="flex col-f-1 flex-space">';
$docs = get_field('dokument', $product_id);
if ($docs) {
foreach ($docs as $doc) {
$docarray = get_field('fil', $doc);
$furl = $docarray['url'] ?? '';
echo '<a href="' . $furl . '" target="_blank" class="flex col-1-2"><i class="icon-download"></i><span>' . get_the_title($doc) . '</span></a>';
}
}
echo '</div>';
}
Ta bort fält i Cart
remove_action('woocommerce_cart_collaterals', 'woocommerce_cross_sell_display');
add_filter('woocommerce_coupons_enabled', 'no_coupon');
function no_coupon($enabled) {
if (is_checkout()) {$enabled = false;}
if (is_cart()) {$enabled = false;}
return $enabled;
}
add_action('woocommerce_cart_collaterals', 'remove_cart_totals', 9);
function remove_cart_totals() {
// Remove cart totals block
remove_action('woocommerce_cart_collaterals', 'woocommerce_cart_totals', 10);
// Add back "Proceed to checkout" button (and hooks)
echo '<div class="cart_totals">';
do_action('woocommerce_before_cart_totals');
echo '<div class="wc-proceed-to-checkout">';
do_action('woocommerce_proceed_to_checkout');
echo '</div>';
do_action('woocommerce_after_cart_totals');
echo '</div><br clear="all">';
}
add_filter('woocommerce_checkout_fields', 'unrequire_checkout_fields');
function unrequire_checkout_fields($fields) {
$fields['billing']['billing_address_1']['required'] = false;
$fields['billing']['billing_address_2']['required'] = false;
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
unset($fields['order']['order_comments']);
return $fields;
}
add_filter('woocommerce_enable_order_notes_field', '__return_false', 9999);
Ändra innehåll i WC-loop
/* Gör att både titel och term description hamnar i samma div. */
function custom_before() {
echo '<div class="textwrap">';
}
add_action('woocommerce_before_subcategory_title', 'custom_before');
/* För att lägga till samma div som ovan även för single products */
add_action('woocommerce_before_shop_loop_item_title', 'custom_before');
/* */
function custom_after($category) {
$cat_id = $category->term_id;
$prod_term = get_term($cat_id, 'product_cat');
$description = $prod_term->description;
if (is_shop()) :
echo '<div class="desc">' . $description . '</div></div>';
endif;
}
add_action('woocommerce_after_subcategory_title', 'custom_after');
function custom_aftertwo() {
global $product, $wpdb;
echo '<span class="sku"><strong>Art. no: </strong>' . $product->get_sku() . '</span>';
}
add_action('woocommerce_after_shop_loop_item_title', 'custom_aftertwo');
remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
WC: Offert istället för köp
remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
add_filter('woocommerce_is_purchasable', '__return_TRUE');
/* För produktsidor */
add_filter('woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_single_add_to_cart_text');
function woocommerce_custom_single_add_to_cart_text() {
return __('Request for quote');
}
/* För kassan */
function my_custom_checkout_button_text() {
return __('Send request');
}
add_filter('woocommerce_order_button_text', 'my_custom_checkout_button_text');
add_action('woocommerce_cart_collaterals', 'remove_cart_totals', 9);
function remove_cart_totals() {
// Remove cart totals block
remove_action('woocommerce_cart_collaterals', 'woocommerce_cart_totals', 10);
// Add back "Proceed to checkout" button (and hooks)
echo '<div class="cart_totals">';
do_action('woocommerce_before_cart_totals');
echo '<div class="wc-proceed-to-checkout">';
do_action('woocommerce_proceed_to_checkout');
echo '</div>';
do_action('woocommerce_after_cart_totals');
echo '</div><br clear="all">';
}
WC: Ändra antal produkter
if (!function_exists('loop_columns')) {
function loop_columns() {
return 3;
}
}
add_filter('loop_shop_columns', 'loop_columns', 999);
function new_loop_shop_per_page($cols) {
$cols = 60;
return $cols;
}
add_filter('loop_shop_per_page', 'new_loop_shop_per_page', 20);
add_filter('woocommerce_output_related_products_args', 'jk_related_products_args', 20);
function jk_related_products_args($args) {
$args['posts_per_page'] = 6;
$args['columns'] = 3;
return $args;
}
WC Ajax Cart Counter
/* AJAX update */
function iconic_cart_count_fragments($fragments) {
$fragments['.icon-cart span'] = '<span>' . WC()->cart->get_cart_contents_count() . '</span>';
return $fragments;
} add_filter('woocommerce_add_to_cart_fragments', 'iconic_cart_count_fragments', 10, 1);
/* Skriv ut */
<i class="icon-cart"><span>' . WC()->cart->get_cart_contents_count() . '</span></i>
Översätt WC
function translate_woocommerce($translation, $text, $domain) {
if ($domain == 'woocommerce') {
switch ($text) {
case 'SKU':
$translation = 'Art. no';
break;
case 'Tags:':
$translation = 'Types:';
break;
}
}
return $translation;
}
add_filter('gettext', 'translate_woocommerce', 10, 3);
WC support (inbyggt)
function mytheme_add_woocommerce_support() {
add_theme_support('woocommerce');
}
add_action('after_setup_theme', 'mytheme_add_woocommerce_support');
function add_woocommerce_picture_settings() {
add_theme_support('wc-product-gallery-slider'); /* Slideshow/galleri, single product */
add_theme_support('wc-product-gallery-lightbox'); /* Lightbox på bilder, single product */
add_theme_support('wc-product-gallery-zoom'); /* Zoom på bild, single product */
}
add_action('after_setup_theme', 'add_woocommerce_picture_settings');
function update_woo_flexslider_options($options) {
$options['directionNav'] = true;
return $options;
}
add_filter('woocommerce_single_product_carousel_options', 'update_woo_flexslider_options');