Skip to content

Instantly share code, notes, and snippets.

View ichaykin's full-sized avatar
🙃

ichaykin ichaykin

🙃
View GitHub Profile
diff --git a/app/Tygh/Backend/Database/Pdo.php b/app/Tygh/Backend/Database/Pdo.php
index 4570c966da..f08d83deef 100644
--- a/app/Tygh/Backend/Database/Pdo.php
+++ b/app/Tygh/Backend/Database/Pdo.php
@@ -47,7 +47,12 @@ class Pdo implements IBackend
@list($host) = explode(':', $host);
try {
- $this->conn = new \PDO("mysql:host=$host;dbname=$database", $user, $passwd);
+ $this->conn = new \PDO(
diff --git a/app/addons/stripe/src/Payments/Stripe.php b/app/addons/stripe/src/Payments/Stripe.php
index 6d336d5978..0c8620b606 100644
--- a/app/addons/stripe/src/Payments/Stripe.php
+++ b/app/addons/stripe/src/Payments/Stripe.php
@@ -228,13 +228,62 @@ class Stripe
{
$result = new OperationResult(false);
- $intent = PaymentIntent::create([
+ $intent_params = [
diff --git a/app/functions/fn.products.php b/app/functions/fn.products.php
index 8d2295e93c..3fc4f06e12 100644
--- a/app/functions/fn.products.php
+++ b/app/functions/fn.products.php
@@ -1170,8 +1170,7 @@ function fn_global_update_products($update_data)
$product['tracking'] !== ProductTracking::DO_NOT_TRACK
&& $old_amount <= 0
&& $new_amount > 0
- && ($product['status'] === ObjectStatuses::ACTIVE
- || $product['status'] === ObjectStatuses::HIDDEN)
diff --git a/design/backend/css/tygh/utils/select2.less b/design/backend/css/tygh/utils/select2.less
index 8cc5b01587..7a0f9d41d8 100644
--- a/design/backend/css/tygh/utils/select2.less
+++ b/design/backend/css/tygh/utils/select2.less
@@ -594,8 +594,8 @@ select#customer_add {
}
}
-.object-picker__advanced-btn--products {
- padding: 5px 12px;
diff --git a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Payments/StripeConnect.php b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Payments/StripeConnect.php
index 5494b53626..ff53052bf9 100644
--- a/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Payments/StripeConnect.php
+++ b/app/addons/stripe_connect/Tygh/Addons/StripeConnect/Payments/StripeConnect.php
@@ -432,14 +432,13 @@ class StripeConnect
$accounting_withdrawal = $order_info['total'] - $application_fee;
$transfer_withdrawal = $accounting_withdrawal;
- $transfer_withdrawal = $this->formatAmount($transfer_withdrawal);
-
diff --git a/_tools/migration/scripts/4.15.1/post_script.php b/_tools/migration/scripts/4.15.1/post_script.php
index 797ca35c41..cfa4292c9d 100644
--- a/_tools/migration/scripts/4.15.1/post_script.php
+++ b/_tools/migration/scripts/4.15.1/post_script.php
@@ -55,3 +55,12 @@ if ($has_old_robokassa_processor) {
fn_update_addon_status('robokassa', Registry::ifGet('addons.rus_payments.status', ObjectStatuses::DISABLED));
}
}
+
+if (Registry::get('addons.stripe_connect.status')) {
diff --git a/design/themes/responsive/templates/addons/master_products/hooks/products/product_form_close_tag.override.tpl b/design/themes/responsive/templates/addons/master_products/hooks/products/product_form_close_tag.override.tpl
new file mode 100644
index 0000000000..7e746a4391
--- /dev/null
+++ b/design/themes/responsive/templates/addons/master_products/hooks/products/product_form_close_tag.override.tpl
@@ -0,0 +1,4 @@
+{if $product.master_product_id || !$product.company_id}
+ {$form_close="form_close_`$product.best_product_offer_id`"}
+ {$smarty.capture.$form_close nofilter}
+{/if}
diff --git a/app/controllers/frontend/checkout.php b/app/controllers/frontend/checkout.php
index 4df88db9f8..df2ec00828 100644
--- a/app/controllers/frontend/checkout.php
+++ b/app/controllers/frontend/checkout.php
@@ -43,6 +43,10 @@ $cart = &Tygh::$app['session']['cart'];
$view = Tygh::$app['view'];
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+ if ($mode === 'add') {
+ $cart['hd_skip_calculate_shipping'] = true;
diff --git a/design/backend/templates/views/shippings/update.tpl b/design/backend/templates/views/shippings/update.tpl
index 5c74b6ea16..cef1756bd2 100644
--- a/design/backend/templates/views/shippings/update.tpl
+++ b/design/backend/templates/views/shippings/update.tpl
@@ -244,7 +244,7 @@
</div>
</div>
-{if "MULTIVENDOR"|fn_allowed_for && $allow_save}
+{if "MULTIVENDOR"|fn_allowed_for && $allow_save && $auth.user_type === "UserTypes::ADMIN"|enum}
diff --git a/app/addons/product_variations/src/HookHandlers/ProductsHookHandler.php b/app/addons/product_variations/src/HookHandlers/ProductsHookHandler.php
index 62ab242653..b96a79978a 100644
--- a/app/addons/product_variations/src/HookHandlers/ProductsHookHandler.php
+++ b/app/addons/product_variations/src/HookHandlers/ProductsHookHandler.php
@@ -1382,13 +1382,21 @@ class ProductsHookHandler
$query = ServiceProvider::getQueryFactory()->createQuery(
ProductRepository::TABLE_PRODUCT_FEATURE_VALUES,
['variant_id' => $variant_ids, 'lang_code' => CART_LANGUAGE],
- ['fv.feature_id'],
- 'fv'