This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client'; | |
// [>] Developer Notes | |
// | |
// * Made for use with Catalyst, by BigCommerce: https://www.catalyst.dev/ | |
// | |
// * Requires NEXT_PUBLIC_PAYPAL_CLIENT_ID env var | |
// - By default it will fall back to 'test' if not set, which uses the non-transacting PayPal sandbox | |
// - You can get your PayPal Client ID here: https://developer.paypal.com/dashboard/applications/live | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'bigcommerce/channels/enable-multi-channel', '__return_true' ); | |
if (function_exists('geoip_detect2_get_info_from_current_ip')) { | |
$userInfo = geoip_detect2_get_info_from_current_ip(); | |
if ($userInfo->country->isoCode == 'FR') { | |
add_filter( 'bigcommerce/channel/current', function( $channel ) { | |
// logic to set the channel | |
return get_term( 41, \BigCommerce\Taxonomies\Channel\Channel::NAME ); | |
}, 10, 1 ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.languagepicker { | |
background-color: #FFF; | |
display: inline-block; | |
padding: 0; | |
height: 40px; | |
overflow: hidden; | |
transition: all .3s ease; | |
margin: 0 50px 10px 0; | |
vertical-align: top; | |
position: absolute; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$bc4wp_regions = [ | |
'en' => [ | |
'img' => 'http://i64.tinypic.com/fd60km.png', | |
'url' => '?region=en', | |
'label' => 'United States', | |
], | |
'fr' => [ | |
'img' => 'http://i65.tinypic.com/300b30k.png', | |
'url' => '?region=fr', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace BigCommerce\Accounts; | |
use Bigcommerce\Api\Client; | |
use Bigcommerce\Api\Resource; | |
use Bigcommerce\Api\Resources\Address; | |
use Bigcommerce\Api\Resources\Order; | |
use Bigcommerce\Api\Resources\OrderProduct; | |
use BigCommerce\Container\Cli; | |
class Customer { | |
const CUSTOMER_ID_META = 'bigcommerce_customer_id'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use BigCommerce\Accounts\Customer; | |
const GUEST_CUSTOMER_GROUP_ID = 2; | |
// Check if transient is set for the guest customer group details. If not, fetch them and store as a transient for 24 hours. | |
// https://codex.wordpress.org/Transients_API | |
if ( !get_transient( 'guest_customer_group_category_access' ) && GUEST_CUSTOMER_GROUP_ID !== 0 ) { | |
$customer = new Customer(); | |
$customer_group_category_access = $customer->get_customer_group_category_access(GUEST_CUSTOMER_GROUP_ID); | |
set_transient( 'guest_customer_group_category_access', $customer_group_category_access, DAY_IN_SECONDS ); |