Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge with master code fix #406

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions includes/api/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,27 @@ function addMagicCheckoutSettingFields(&$defaultFormFields)
'label' => __('Allow customers to create store Account'),
'default' => 'No',
),
'enable_dual_checkout_oncart' => array(
'title' => __('Activate Dual checkout on cart'),
'type' => 'checkbox',
'description' => "Activate Dual checkout on cart page",
'label' => __('Activate Dual checkout on cart'),
'default' => 'yes',
),
'enable_dual_checkout_onpdp' => array(
'title' => __('Activate Dual checkout on Buynow'),
'type' => 'checkbox',
'description' => "Activate Dual checkout on Product description Page",
'label' => __('Activate Dual checkout on Buynow'),
'default' => 'yes',
),
'enable_dual_checkout_minicart' => array(
'title' => __('Activate Dual checkout on minicart'),
'type' => 'checkbox',
'description' => 'Activate Dual checkout on minicart',
'label' => __('Activate Dual checkout on minicart'),
'default' => 'yes',
),
);

$defaultFormFields = array_merge($defaultFormFields, $magicCheckoutConfigFields);
Expand Down
13 changes: 13 additions & 0 deletions includes/stylehandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
function styleHandler($theme){

$theme = strtolower(str_replace(' ', '', $theme));
$defaultStyle = plugin_dir_url(__DIR__) . 'public/css/1cc-product-checkout.css';
$cssFilePath = plugin_dir_path( __DIR__ ). '/public/css/'. $theme .'.css';
$css = plugin_dir_url(__DIR__) . 'public/css/'. $theme .'.css';

return is_file($cssFilePath)?
$css
:$defaultStyle;
}
?>
25 changes: 25 additions & 0 deletions includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,31 @@ function isMandatoryAccCreationEnabled()
&& 'yes' == get_option('woocommerce_razorpay_settings')['1cc_account_creation']
);
}

function isDualMiniCartCheckoutEnabled()
{
return (
empty(get_option('woocommerce_razorpay_settings')['enable_dual_checkout_minicart']) === false
&& 'yes' == get_option('woocommerce_razorpay_settings')['enable_dual_checkout_minicart']
);
}

function isDualPdpCheckoutEnabled()
{
return (
empty(get_option('woocommerce_razorpay_settings')['enable_dual_checkout_onpdp']) === false
&& 'yes' == get_option('woocommerce_razorpay_settings')['enable_dual_checkout_onpdp']
);
}

function isDualCartCheckoutEnabled()
{
return (
empty(get_option('woocommerce_razorpay_settings')['enable_dual_checkout_oncart']) === false
&& 'yes' == get_option('woocommerce_razorpay_settings')['enable_dual_checkout_oncart']
);
}

function validateInput($route, $param)
{
$failure_reason = null;
Expand Down
Empty file modified public/css/1cc-product-checkout.css
100644 → 100755
Empty file.
92 changes: 92 additions & 0 deletions public/css/astra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#btn-1cc {
display: block !important;
width: 100%;
}
#btn-1cc-mini-cart {
display: block !important;
width: 100%;
}
#btn-1cc-pdp {
position: relative;
top: 10px;
display: block !important;
width: 220px;
border-radius: 2px;
overflow: hidden;
}
#rzp-spinner-backdrop {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
height: 100%;
background: rgba(0, 0, 0);
visibility: hidden;
opacity: 0;
}
#rzp-spinner-backdrop.show {
visibility: visible;
opacity: 0.4;
}
#rzp-spinner {
visibility: hidden;
opacity: 0;
/* positioning and centering */
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
z-index: 10000;
display: flex !important;
align-items: center;
justify-content: center;
}
#rzp-spinner.show {
visibility: visible;
opacity: 1;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
#loading-indicator {
border-radius: 50%;
width: 80px;
height: 80px;
border: 4px solid;
border-color: rgb(59, 124, 245) transparent rgb(59, 124, 245) rgb(59, 124, 245) !important;
animation: 1s linear 0s infinite normal none running rotate;
margin-top: 2px;
box-sizing: content-box;
}
#icon {
position: absolute;
}
#rzp-logo{
width: auto;
height: 80px !important;
}
@media (max-device-height: 768px), (max-device-width: 768px) {
#loading-indicator {
width: 45px;
height: 45px;
}
#rzp-logo {
height: 45px !important;
}
}

.single_add_to_cart_button.button{
z-index: 2 !important;
}

.quantity{
z-index: 2 !important;
}
110 changes: 110 additions & 0 deletions public/css/bigstore.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#btn-1cc {
display: block !important;
width: 100%;
}
#btn-1cc-mini-cart {
display: block !important;
width: 100%;
}
#btn-1cc-pdp {
display:block !important;
position: relative;
top: 12px;
width: 352px;
}
#rzp-spinner-backdrop {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
height: 100%;
background: rgba(0, 0, 0);
visibility: hidden;
opacity: 0;
}
#rzp-spinner-backdrop.show {
visibility: visible;
opacity: 0.4;
}
#rzp-spinner {
visibility: hidden;
opacity: 0;
/* positioning and centering */
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
z-index: 10000;
display: flex !important;
align-items: center;
justify-content: center;
}
#rzp-spinner.show {
visibility: visible;
opacity: 1;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
#loading-indicator {
border-radius: 50%;
width: 80px;
height: 80px;
border: 4px solid;
border-color: rgb(59, 124, 245) transparent rgb(59, 124, 245) rgb(59, 124, 245) !important;
animation: 1s linear 0s infinite normal none running rotate;
margin-top: 2px;
box-sizing: content-box;
}
#icon {
position: absolute;
}
#rzp-logo{
width: auto;
height: 80px !important;
}
@media (max-device-height: 768px), (max-device-width: 768px) {
#loading-indicator {
width: 45px;
height: 45px;
}
#rzp-logo {
height: 45px !important;
}
}

@media screen and (max-width: 1024px){

#btn-1cc-pdp{
width: 323px;
padding-top: 20px;
}

}

@media screen and (max-width: 767px){
#btn-1cc-pdp{
width: 232px;
padding-top: 20px;
}

}


.single_add_to_cart_button.button{
z-index: 2 !important;
}

.quantity{
z-index: 2 !important;
}


91 changes: 91 additions & 0 deletions public/css/blossomshop.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#btn-1cc {
display: block !important;
width: 100%;
}
#btn-1cc-mini-cart {
display: block !important;
width: 100%;
}
#btn-1cc-pdp {
display:block !important;
position: relative;
top: 11px;
width: 241px;
}
#rzp-spinner-backdrop {
position: fixed;
top: 0;
left: 0;
z-index: 9999;
width: 100%;
height: 100%;
background: rgba(0, 0, 0);
visibility: hidden;
opacity: 0;
}
#rzp-spinner-backdrop.show {
visibility: visible;
opacity: 0.4;
}
#rzp-spinner {
visibility: hidden;
opacity: 0;
/* positioning and centering */
position: fixed;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
z-index: 10000;
display: flex !important;
align-items: center;
justify-content: center;
}
#rzp-spinner.show {
visibility: visible;
opacity: 1;
}
@keyframes rotate {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
#loading-indicator {
border-radius: 50%;
width: 80px;
height: 80px;
border: 4px solid;
border-color: rgb(59, 124, 245) transparent rgb(59, 124, 245) rgb(59, 124, 245) !important;
animation: 1s linear 0s infinite normal none running rotate;
margin-top: 2px;
box-sizing: content-box;
}
#icon {
position: absolute;
}
#rzp-logo{
width: auto;
height: 80px !important;
}
@media (max-device-height: 768px), (max-device-width: 768px) {
#loading-indicator {
width: 45px;
height: 45px;
}
#rzp-logo {
height: 45px !important;
}
}


.single_add_to_cart_button.button{
z-index: 2 !important;
}

.quantity{
z-index: 2 !important;
}
Empty file modified public/css/bootstrap.min.css
100644 → 100755
Empty file.