Skip to content

Instantly share code, notes, and snippets.

View PGeorgiev's full-sized avatar
🚀
WordPress Technical Support @DevriX

Plamen Georgiev PGeorgiev

🚀
WordPress Technical Support @DevriX
View GitHub Profile
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Scripts
*
* @since 1.0
<?php
/**
* Add to cart redirect to checkout.
*
* @param string $url
* @return string
*/
function woocode_wc_add_to_cart_redirect_to_checkout( $url ) {
return wc_get_checkout_url();
<?php
/**
* Display (Free) when shipping method does not charge any cost.
*
* @param String $label Shipping method label.
* @param WC_Shipping_Rate $method Shipping method data.
* @return string
*/
function serdika_free_shipping_label( $label, $method ) {
// Only apply when is free and not using the free shipping method.
@PGeorgiev
PGeorgiev / signup.php
Created February 5, 2019 15:47
Signup page
<section id="lp-top" class="margin-bottom">
<div class="signup-box">
<div class="signup-box-left">
<figure><img class="size-full img-responsive wp-image-6185 size-medium" src="https://dev.brosix.com/wp-content/uploads/brosix-logo-new-resized.png" alt="fullresponsive" width="268" /></figure>
<h1>Sign up for Brosix Team Network</h1>
[contact-form-7 id="13483" title="signup-new"]
</div>
<div>
<h2 class="no-margin-top">Get your 30 day free trial of Brosix Enterprise and enjoy the amazing features:</h2>
@PGeorgiev
PGeorgiev / functions.php
Created February 4, 2019 12:02
shortcode signup page
// ------------------------------------------------
// A simple registration form for the signup page
// ------------------------------------------------
function signup_page_form_new() {
// Configuration. Set these accordingly.
$returnUrl = "https://www.brosix.com/signup/";
$partnerID = "en.brosix.com-signup";
// Do not change
$WHITELABEL_API_URL = "https://box-n2.brosix.com/net/signup/process/creating/";
@PGeorgiev
PGeorgiev / subscrice.php
Created January 21, 2019 12:24
Custom shortcode - susbcribe
/*
* Simple shortcode for Subscribe posts
*/
function shortcode_funct($atts) {
ob_start();
$a = shortcode_atts(array(
// 'header' => 'Header text',
'header' => 'Целият материал е достъпен за абонати на MasterHack. Вече си в клуба? Логни се.',
'text' => 'Този материал е част от оригиналното премиум съдържание на MyJob.BG, достъпен е само за членове на клуб HR Club.',
@PGeorgiev
PGeorgiev / gist:847daa241e0fef7f8574cfaa57e940c6
Created January 21, 2019 08:06
Alow BGN for WooCommerce and PayPal
// allow BGN for WooCommerce and PayPal
add_filter( 'woocommerce_paypal_supported_currencies', 'add_bgn_paypal_valid_currency' );
function add_bgn_paypal_valid_currency( $currencies ) {
array_push ( $currencies , 'BGN' );
return $currencies;
}
// Convert BGN to EUR for PayPal payments
add_filter('woocommerce_paypal_args', 'convert_bgn_to_eur');