Skip to content

Instantly share code, notes, and snippets.

View atanasantonov's full-sized avatar

Atanas Antonov atanasantonov

  • 03:09 (UTC +03:00)
View GitHub Profile
/**
* Register block styles.
*/
function prefix_register_block_styles() {
$blocks = array(
'columns',
'coverImage',
'group',
'gallery',
'heading',
@atanasantonov
atanasantonov / payment.php
Last active May 21, 2022 08:11
Suggested modifications in WatuPRO
// Location: watupro/i/models/payment.php
// Line: 43
// Add hooks to modify reidrect.
$ww_bridge_redirect = apply_filters( 'watupro_payment_render_ww_bridge_redirect', true, $exam, $user_ID );
$link = get_permalink($advanced_settings['woo_product_id']);
if ( $ww_bridge_redirect && $link ) {
watupro_redirect($link);
} else {
@atanasantonov
atanasantonov / .htaccess
Created January 14, 2022 14:20
Cross domain resourses loading
<IfModule mod_headers.c>
<FilesMatch "\.(jpg|png)$">
Header set Access-Control-Allow-Credentials true
SetEnvIf Origin "http(s)?://(www\.)?(example.com|anotherexample.com)$" AccessControlAllowOrigin=$0
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header merge Vary Origin
</FilesMatch>
</IfModule>
@atanasantonov
atanasantonov / functions.php
Created January 11, 2022 17:33
Fix Deliver with Econt checkout process for virtual products
/**
* Fix Deliver with Econt checkout process.
*
* Check cart for virtual products and remove action 'action_woocommerce_checkout_process'
* hooked in plugins/deliver-with-econt/bootstrap.php:393 if there are only
* virtual products.
*/
function fix_econt_checkout_process() {
// Change this to 0 to disable logging.
@atanasantonov
atanasantonov / CurlClient.php
Last active July 24, 2020 08:29
Logging Examples
2020-07-24T11:20:33+03:00 DEBUG CurlClient request method: post
2020-07-24T11:20:33+03:00 DEBUG CurlClient request set opts: Array
(
[CURLOPT_POST] => 1
[CURLOPT_HTTPHEADER] => Array
(
[0] => Content-Type:application/json
)
[CURLOPT_POSTFIELDS] => {"merchantOrderID":"200","merchantOrderDesc":"Test order description","orderAmount":"100.00","orderCurrency":"USD","customerEmail":"testing@zotapay-php-sdk.com","customerFirstName":"John","customerLastName":"Lock","customerAddress":"The Swan, Jungle St. 108","customerCountryCode":"US","customerCity":"Los Angeles","customerState":"CA","customerZipCode":"90015","customerPhone":"+1 420-100-1000","customerIP":"134.201.250.130","customerBankCode":"","redirectUrl":"http:\/\/localhost\/redirect","callbackUrl":"http:\/\/localhost\/callback","checkoutUrl":"http:\/\/localhost\/checkout","customParam":"{\"TestCustomParam\":\"123\"}","language":"EN","signature":"7affe8ef06db0863a05c0c03e5d42f3d728cbc69fc8fd6026098e22864aa93e4"}