Skip to content

Instantly share code, notes, and snippets.

View ichaykin's full-sized avatar
🙃

ichaykin ichaykin

🙃
View GitHub Profile
diff --git a/app/addons/master_products/func.php b/app/addons/master_products/func.php
index 1593311..144289a 100644
--- a/app/addons/master_products/func.php
+++ b/app/addons/master_products/func.php
@@ -137,7 +137,7 @@ function fn_master_products_get_products(
}
$condition .= db_quote(' AND products.master_product_id = ?i', $master_product_id);
- } elseif (empty($params['runtime_company_id']) && empty($params['pid'])) {
+ } elseif (empty($params['runtime_company_id']) && empty($params['pid']) && empty($params['only_for_counting'])) {
diff --git a/design/themes/responsive/templates/views/checkout/components/profile_fields/s_country.tpl b/design/themes/responsive/templates/views/checkout/components/profile_fields/s_country.tpl
index 7bdf8cb..bc64ff3 100644
--- a/design/themes/responsive/templates/views/checkout/components/profile_fields/s_country.tpl
+++ b/design/themes/responsive/templates/views/checkout/components/profile_fields/s_country.tpl
@@ -3,6 +3,7 @@
<select data-ca-lite-checkout-field="user_data.s_country"
class="cm-country cm-location-shipping litecheckout__input litecheckout__input--selectable litecheckout__input--selectable--select"
data-ca-lite-checkout-element="country"
+ data-ca-lite-checkout-last-value="{$user_data.s_country}"
required
diff --git a/app/controllers/backend/init.php b/app/controllers/backend/init.php
index f00a4eb..f468e3b 100644
--- a/app/controllers/backend/init.php
+++ b/app/controllers/backend/init.php
@@ -276,6 +276,7 @@ Tygh::$app['view']->assign('store_mode', $store_mode);
Tygh::$app['view']->assign('product_state_suffix', $product_state_suffix);
Tygh::$app['view']->assign('store_mode_number_of_storefronts', count(fn_get_all_companies_ids()));
Tygh::$app['view']->assign('store_mode_allowed_number_of_storefronts', fn_get_storage_data('allowed_number_of_stores'));
+Tygh::$app['view']->assign('hash_of_available_countries', fn_get_hash_of_available_countries());
diff --git a/js/addons/help_center/func.js b/js/addons/help_center/func.js
index 308dac3..390f4b3 100644
--- a/js/addons/help_center/func.js
+++ b/js/addons/help_center/func.js
@@ -1,7 +1,8 @@
(function(_, $){
$.ceEvent('on', 'ce.commoninit', function (context) {
if ($(context).is(document)) {
- fnInitHelpCenter();
+ setTimeout(fnInitHelpCenter, 2000);
diff --git a/app/Tygh/Notifications/Transports/Internal/InternalMessageSchema.php b/app/Tygh/Notifications/Transports/Internal/InternalMessageSchema.php
index 899611ad58..1db3676221 100644
--- a/app/Tygh/Notifications/Transports/Internal/InternalMessageSchema.php
+++ b/app/Tygh/Notifications/Transports/Internal/InternalMessageSchema.php
@@ -84,6 +84,7 @@ class InternalMessageSchema extends BaseMessageSchema
public function init(Data $data)
{
$self = parent::init($data);
+ $data = new Data($self->data);
diff --git a/app/addons/vendor_plans/Tygh/Models/Company.php b/app/addons/vendor_plans/Tygh/Models/Company.php
index a3071d60e1..be0aad407b 100644
--- a/app/addons/vendor_plans/Tygh/Models/Company.php
+++ b/app/addons/vendor_plans/Tygh/Models/Company.php
@@ -509,4 +509,10 @@ class Company extends AModel
return isset($this->current_attributes['email']) ? $this->current_attributes['email'] : '';
}
+
+ /** @inheritdoc */
diff --git a/app/addons/vendor_plans/func.php b/app/addons/vendor_plans/func.php
index 4654a06f0d..f7b38b4065 100644
--- a/app/addons/vendor_plans/func.php
+++ b/app/addons/vendor_plans/func.php
@@ -240,17 +240,16 @@ function fn_vendor_plans_update_company(&$company_data, &$company_id, &$lang_cod
) {
$company = Company::model()->find($company_id);
$current_plan = VendorPlan::model()->find($company_data['current_plan']);
+
/** @var \Tygh\Notifications\EventDispatcher $event_dispatcher */
diff --git a/app/functions/fn.categories.php b/app/functions/fn.categories.php
index c3fb61f159..06284fb602 100644
--- a/app/functions/fn.categories.php
+++ b/app/functions/fn.categories.php
@@ -624,7 +624,7 @@ function fn_get_categories_list_with_parents(array $category_ids, $lang_code = C
$parent_ids = explode('/', $category['id_path']);
array_pop($parent_ids);
- $category['parents'] = fn_sort_by_ids(
+ $category['parents'] = fn_get_items_by_ids(
diff --git a/app/addons/paypal/paypal_express.functions.php b/app/addons/paypal/paypal_express.functions.php
index c88bd2c6de..6caf976a41 100644
--- a/app/addons/paypal/paypal_express.functions.php
+++ b/app/addons/paypal/paypal_express.functions.php
@@ -336,15 +336,19 @@ function fn_paypal_build_details(array $data, array $processor_data)
function fn_paypal_get_shipping_data($data)
{
$shipping_data = array();
- if (!empty($data) && (!empty($data['s_firstname']) || !empty($data['s_lastname'])) && !empty($data['s_address']) && !empty($data['s_city'])) {
+ if (!empty($data) && !empty($data['s_address']) && !empty($data['s_city'])) {
diff --git a/1.tpl b/1.tpl
new file mode 100644
index 0000000000..10745f4ca7
--- /dev/null
+++ b/1.tpl
@@ -0,0 +1,65 @@
+{capture name="mainbox"}
+
+ <form action="{""|fn_url}" method="post" id="states_form" name="states_form">
+ {include file="common/pagination.tpl" save_current_page=true save_current_url=true}