Автор Тема: Оформление заказа  (Прочитано 1760 раз)

21 Декабрь 2016, 16:41:37
Ответ #30
  • Ветеран
  • *****
  • Сообщений: 16670
  • Репутация: +14630/-5
  • Сообщество PrestaShop
    • Просмотр профиля
Перемененые есть, только значения нулевые. При переходе на этап Доставки не сохраняются значения.
В контроллере /controllers/front/OrderController.php для проверки добавьте в метод initContent()
case OrderController::STEP_DELIVERY:
    if (Tools::isSubmit('processAddress')) {
        $this->processAddress();
    }
    $this->autoStep();
    $this->_assignCarrier();
    $this->context->cart->dateivremt = '2016-12-21 12:12:12';
    $this->context->cart->exp = '1';
    $this->setTemplate(_PS_THEME_DIR_.'order-carrier.tpl');
    break;
21 Декабрь 2016, 17:09:18
Ответ #31
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Добавил как вы написали, результат остался тот же что и был до этого.
23 Декабрь 2016, 09:54:07
Ответ #32
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Может я в order-address.tpl некорректно их объявил?
Желаемые дата и время доставки:
<input type="text" name="dateivremt" id="dateivremt" value="2017-01-01 10:00:00">
<p class="checkbox">
<label for="exp">
<input type="checkbox" name="exp" id="exp" value="1" {if isset($smarty.post.exp) && $smarty.post.exp == '1'}checked="checked"{/if} />
Необходим предварительный созвон</label>
</p>
23 Декабрь 2016, 12:01:42
Ответ #33
  • Ветеран
  • *****
  • Сообщений: 16670
  • Репутация: +14630/-5
  • Сообщество PrestaShop
    • Просмотр профиля
В шаблоне нормально.
23 Декабрь 2016, 14:18:06
Ответ #34
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Не понимаю, тогда почему нули передаются если все верно?
23 Декабрь 2016, 15:38:33
Ответ #35
  • Ветеран
  • *****
  • Сообщений: 3419
  • Репутация: +79/-6
  • Сообщество PrestaShop
    • Просмотр профиля
Потому что сами переменные не сохраняются в cart. Выведи cart перед сохранением и посмотри.
23 Декабрь 2016, 16:35:58
Ответ #36
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Как это корректно сделать?
23 Декабрь 2016, 18:52:36
Ответ #37
  • Ветеран
  • *****
  • Сообщений: 16670
  • Репутация: +14630/-5
  • Сообщество PrestaShop
    • Просмотр профиля
26 Декабрь 2016, 09:42:06
Ответ #38
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Вот что выдало при оформлении заказа, когда еще ничего не выбрано:
object(Cart)#20 (43) { ["id"]=> int(58) ["id_shop_group"]=> string(1) "1" ["id_shop"]=> string(1) "1" ["id_address_delivery"]=> string(1) "5" ["id_address_invoice"]=> string(1) "5" ["id_currency"]=> string(1) "1" ["id_customer"]=> string(1) "2" ["id_guest"]=> string(1) "2" ["id_lang"]=> string(1) "1" ["recyclable"]=> string(1) "0" ["gift"]=> string(1) "0" ["gift_message"]=> string(0) "" ["mobile_theme"]=> string(1) "0" ["date_add"]=> string(19) "2016-12-26 09:36:44" ["secure_key"]=> string(32) "10a7a3df4a163c0a58023e54f477705a" ["id_carrier"]=> int(3) ["date_upd"]=> string(19) "2016-12-26 09:36:46" ["checkedTos"]=> bool(false) ["pictures"]=> NULL ["textFields"]=> NULL ["delivery_option"]=> string(19) "a:1:{i:5;s:2:"3,";}" ["allow_seperated_package"]=> string(1) "0" ["_products":protected]=> array(1) { [0]=> array(63) { ["id_product_attribute"]=> string(2) "13" ["id_product"]=> string(1) "3" ["cart_quantity"]=> string(1) "1" ["id_shop"]=> string(1) "1" ["name"]=> string(13) "Printed Dress" ["is_virtual"]=> string(1) "0" ["description_short"]=> string(113) "
100% cotton double printed dress. Black and white striped top and orange high waisted skater skirt bottom.

" ["available_now"]=> string(8) "In stock" ["available_later"]=> string(0) "" ["id_category_default"]=> string(1) "9" ["id_supplier"]=> string(1) "1" ["id_manufacturer"]=> string(1) "1" ["on_sale"]=> string(1) "0" ["ecotax"]=> string(8) "0.000000" ["additional_shipping_cost"]=> string(4) "0.00" ["available_for_order"]=> string(1) "1" ["price"]=> float(25.999852) ["active"]=> string(1) "1" ["unity"]=> string(0) "" ["unit_price_ratio"]=> string(8) "0.000000" ["quantity_available"]=> string(3) "285" ["width"]=> string(8) "0.000000" ["height"]=> string(8) "0.000000" ["depth"]=> string(8) "0.000000" ["out_of_stock"]=> string(1) "2" ["weight"]=> float(0) ["date_add"]=> string(19) "2016-10-24 10:57:50" ["date_upd"]=> string(19) "2016-10-24 10:57:50" ["quantity"]=> int(1) ["link_rewrite"]=> string(13) "printed-dress" ["category"]=> string(14) "casual-dresses" ["unique_id"]=> string(21) "000000000300000000135" ["id_address_delivery"]=> string(1) "5" ["advanced_stock_management"]=> string(1) "0" ["supplier_reference"]=> NULL ["customization_quantity"]=> NULL ["id_customization"]=> NULL ["price_attribute"]=> string(8) "0.000000" ["ecotax_attr"]=> string(8) "0.000000" ["reference"]=> string(6) "demo_3" ["weight_attribute"]=> string(8) "0.000000" ["ean13"]=> string(1) "0" ["upc"]=> string(0) "" ["minimal_quantity"]=> string(1) "1" ["wholesale_price"]=> string(8) "7.800000" ["id_image"]=> string(3) "3-8" ["legend"]=> string(0) "" ["reduction_type"]=> int(0) ["stock_quantity"]=> int(285) ["price_without_reduction"]=> float(30.679825) ["price_with_reduction"]=> float(30.679825) ["price_with_reduction_without_tax"]=> float(25.999852) ["total"]=> float(26) ["total_wt"]=> float(30.68) ["price_wt"]=> float(30.679825) ["reduction_applies"]=> bool(false) ["quantity_discount_applies"]=> bool(false) ["allow_oosp"]=> int(0) ["features"]=> array(3) { [0]=> array(3) { ["id_feature"]=> string(1) "5" ["id_product"]=> string(1) "3" ["id_feature_value"]=> string(1) "5" } [1]=> array(3) { ["id_feature"]=> string(1) "6" ["id_product"]=> string(1) "3" ["id_feature_value"]=> string(2) "13" } [2]=> array(3) { ["id_feature"]=> string(1) "7" ["id_product"]=> string(1) "3" ["id_feature_value"]=> string(2) "18" } } ["attributes"]=> string(24) "Size : S, Color : Orange" ["attributes_small"]=> string(9) "S, Orange" ["rate"]=> float(18) ["tax_name"]=> string(13) "НДС RU 18%" } } ["_taxCalculationMethod":protected]=> string(1) "0" ["dateivremt"]=> string(19) "0000-00-00 00:00:00" ["exp"]=> string(1) "0" ["webserviceParameters":protected]=> array(2) { ["fields"]=> array(6) { ["id_address_delivery"]=> array(1) { ["xlink_resource"]=> string(9) "addresses" } ["id_address_invoice"]=> array(1) { ["xlink_resource"]=> string(9) "addresses" } ["id_currency"]=> array(1) { ["xlink_resource"]=> string(10) "currencies" } ["id_customer"]=> array(1) { ["xlink_resource"]=> string(9) "customers" } ["id_guest"]=> array(1) { ["xlink_resource"]=> string(6) "guests" } ["id_lang"]=> array(1) { ["xlink_resource"]=> string(9) "languages" } } ["associations"]=> array(1) { ["cart_rows"]=> array(3) { ["resource"]=> string(8) "cart_row" ["virtual_entity"]=> bool(true) ["fields"]=> array(4) { ["id_product"]=> array(2) { ["required"]=> bool(true) ["xlink_resource"]=> string(8) "products" } ["id_product_attribute"]=> array(2) { ["required"]=> bool(true) ["xlink_resource"]=> string(12) "combinations" } ["id_address_delivery"]=> array(2) { ["required"]=> bool(true) ["xlink_resource"]=> string(9) "addresses" } ["quantity"]=> array(1) { ["required"]=> bool(true) } } } } } ["id_shop_list"]=> NULL ["get_shop_from_context":protected]=> bool(true) ["table":protected]=> string(4) "cart" ["identifier":protected]=> string(7) "id_cart" ["fieldsRequired":protected]=> array(2) { [0]=> string(11) "id_currency" [1]=> string(7) "id_lang" } ["fieldsSize":protected]=> array(1) { ["secure_key"]=> int(32) } ["fieldsValidate":protected]=> array(18) { ["id_shop_group"]=> string(12) "isUnsignedId" ["id_shop"]=> string(12) "isUnsignedId" ["id_address_delivery"]=> string(12) "isUnsignedId" ["id_address_invoice"]=> string(12) "isUnsignedId" ["id_carrier"]=> string(12) "isUnsignedId" ["id_currency"]=> string(12) "isUnsignedId" ["id_customer"]=> string(12) "isUnsignedId" ["id_guest"]=> string(12) "isUnsignedId" ["id_lang"]=> string(12) "isUnsignedId" ["recyclable"]=> string(6) "isBool" ["gift"]=> string(6) "isBool" ["gift_message"]=> string(9) "isMessage" ["mobile_theme"]=> string(6) "isBool" ["allow_seperated_package"]=> string(6) "isBool" ["date_add"]=> string(6) "isDate" ["date_upd"]=> string(6) "isDate" ["dateivremt"]=> string(12) "isDateFormat" ["exp"]=> string(12) "isUnsignedId" } ["fieldsRequiredLang":protected]=> array(0) { } ["fieldsSizeLang":protected]=> array(0) { } ["fieldsValidateLang":protected]=> array(0) { } ["tables":protected]=> array(0) { } ["image_dir":protected]=> NULL ["image_format":protected]=> string(3) "jpg" ["def":protected]=> array(4) { ["table"]=> string(4) "cart" ["primary"]=> string(7) "id_cart" ["fields"]=> array(20) { ["id_shop_group"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_shop"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_address_delivery"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_address_invoice"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_carrier"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_currency"]=> array(3) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" ["required"]=> bool(true) } ["id_customer"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_guest"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_lang"]=> array(3) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" ["required"]=> bool(true) } ["recyclable"]=> array(2) { ["type"]=> int(2) ["validate"]=> string(6) "isBool" } ["gift"]=> array(2) { ["type"]=> int(2) ["validate"]=> string(6) "isBool" } ["gift_message"]=> array(2) { ["type"]=> int(3) ["validate"]=> string(9) "isMessage" } ["mobile_theme"]=> array(2) { ["type"]=> int(2) ["validate"]=> string(6) "isBool" } ["delivery_option"]=> array(1) { ["type"]=> int(3) } ["secure_key"]=> array(2) { ["type"]=> int(3) ["size"]=> int(32) } ["allow_seperated_package"]=> array(2) { ["type"]=> int(2) ["validate"]=> string(6) "isBool" } ["date_add"]=> array(2) { ["type"]=> int(5) ["validate"]=> string(6) "isDate" } ["date_upd"]=> array(2) { ["type"]=> int(5) ["validate"]=> string(6) "isDate" } ["dateivremt"]=> array(2) { ["type"]=> int(5) ["validate"]=> string(12) "isDateFormat" } ["exp"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } } ["classname"]=> string(4) "Cart" } ["update_fields":protected]=> NULL ["force_id"]=> bool(false) }

А вот что выдало на странице подтверждения заказа:
object(Cart)#27 (43) { ["id"]=> NULL ["id_shop_group"]=> int(1) ["id_shop"]=> int(1) ["id_address_delivery"]=> int(5) ["id_address_invoice"]=> int(5) ["id_currency"]=> int(1) ["id_customer"]=> int(2) ["id_guest"]=> int(2) ["id_lang"]=> int(1) ["recyclable"]=> int(0) ["gift"]=> int(0) ["gift_message"]=> NULL ["mobile_theme"]=> NULL ["date_add"]=> NULL ["secure_key"]=> NULL ["id_carrier"]=> int(0) ["date_upd"]=> NULL ["checkedTos"]=> bool(false) ["pictures"]=> NULL ["textFields"]=> NULL ["delivery_option"]=> NULL ["allow_seperated_package"]=> bool(false) ["_products":protected]=> NULL ["_taxCalculationMethod":protected]=> string(1) "0" ["dateivremt"]=> NULL ["exp"]=> NULL ["webserviceParameters":protected]=> array(2) { ["fields"]=> array(6) { ["id_address_delivery"]=> array(1) { ["xlink_resource"]=> string(9) "addresses" } ["id_address_invoice"]=> array(1) { ["xlink_resource"]=> string(9) "addresses" } ["id_currency"]=> array(1) { ["xlink_resource"]=> string(10) "currencies" } ["id_customer"]=> array(1) { ["xlink_resource"]=> string(9) "customers" } ["id_guest"]=> array(1) { ["xlink_resource"]=> string(6) "guests" } ["id_lang"]=> array(1) { ["xlink_resource"]=> string(9) "languages" } } ["associations"]=> array(1) { ["cart_rows"]=> array(3) { ["resource"]=> string(8) "cart_row" ["virtual_entity"]=> bool(true) ["fields"]=> array(4) { ["id_product"]=> array(2) { ["required"]=> bool(true) ["xlink_resource"]=> string(8) "products" } ["id_product_attribute"]=> array(2) { ["required"]=> bool(true) ["xlink_resource"]=> string(12) "combinations" } ["id_address_delivery"]=> array(2) { ["required"]=> bool(true) ["xlink_resource"]=> string(9) "addresses" } ["quantity"]=> array(1) { ["required"]=> bool(true) } } } } } ["id_shop_list"]=> NULL ["get_shop_from_context":protected]=> bool(true) ["table":protected]=> string(4) "cart" ["identifier":protected]=> string(7) "id_cart" ["fieldsRequired":protected]=> array(2) { [0]=> string(11) "id_currency" [1]=> string(7) "id_lang" } ["fieldsSize":protected]=> array(1) { ["secure_key"]=> int(32) } ["fieldsValidate":protected]=> array(18) { ["id_shop_group"]=> string(12) "isUnsignedId" ["id_shop"]=> string(12) "isUnsignedId" ["id_address_delivery"]=> string(12) "isUnsignedId" ["id_address_invoice"]=> string(12) "isUnsignedId" ["id_carrier"]=> string(12) "isUnsignedId" ["id_currency"]=> string(12) "isUnsignedId" ["id_customer"]=> string(12) "isUnsignedId" ["id_guest"]=> string(12) "isUnsignedId" ["id_lang"]=> string(12) "isUnsignedId" ["recyclable"]=> string(6) "isBool" ["gift"]=> string(6) "isBool" ["gift_message"]=> string(9) "isMessage" ["mobile_theme"]=> string(6) "isBool" ["allow_seperated_package"]=> string(6) "isBool" ["date_add"]=> string(6) "isDate" ["date_upd"]=> string(6) "isDate" ["dateivremt"]=> string(12) "isDateFormat" ["exp"]=> string(12) "isUnsignedId" } ["fieldsRequiredLang":protected]=> array(0) { } ["fieldsSizeLang":protected]=> array(0) { } ["fieldsValidateLang":protected]=> array(0) { } ["tables":protected]=> array(0) { } ["image_dir":protected]=> NULL ["image_format":protected]=> string(3) "jpg" ["def":protected]=> array(4) { ["table"]=> string(4) "cart" ["primary"]=> string(7) "id_cart" ["fields"]=> array(20) { ["id_shop_group"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_shop"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_address_delivery"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_address_invoice"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_carrier"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_currency"]=> array(3) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" ["required"]=> bool(true) } ["id_customer"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_guest"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } ["id_lang"]=> array(3) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" ["required"]=> bool(true) } ["recyclable"]=> array(2) { ["type"]=> int(2) ["validate"]=> string(6) "isBool" } ["gift"]=> array(2) { ["type"]=> int(2) ["validate"]=> string(6) "isBool" } ["gift_message"]=> array(2) { ["type"]=> int(3) ["validate"]=> string(9) "isMessage" } ["mobile_theme"]=> array(2) { ["type"]=> int(2) ["validate"]=> string(6) "isBool" } ["delivery_option"]=> array(1) { ["type"]=> int(3) } ["secure_key"]=> array(2) { ["type"]=> int(3) ["size"]=> int(32) } ["allow_seperated_package"]=> array(2) { ["type"]=> int(2) ["validate"]=> string(6) "isBool" } ["date_add"]=> array(2) { ["type"]=> int(5) ["validate"]=> string(6) "isDate" } ["date_upd"]=> array(2) { ["type"]=> int(5) ["validate"]=> string(6) "isDate" } ["dateivremt"]=> array(2) { ["type"]=> int(5) ["validate"]=> string(12) "isDateFormat" } ["exp"]=> array(2) { ["type"]=> int(1) ["validate"]=> string(12) "isUnsignedId" } } ["classname"]=> string(4) "Cart" } ["update_fields":protected]=> NULL ["force_id"]=> bool(false) }
27 Декабрь 2016, 12:11:18
Ответ #39
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Не могу понять почему сохраняются нули.
27 Декабрь 2016, 14:03:10
Ответ #40
  • Ветеран
  • *****
  • Сообщений: 3419
  • Репутация: +79/-6
  • Сообщество PrestaShop
    • Просмотр профиля
При добавлении товара корзина обновляется и эти переменные не сохраняются.
28 Декабрь 2016, 08:51:17
Ответ #41
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Так все же как мне сохранить вводимые данные?
30 Декабрь 2016, 08:55:33
Ответ #42
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Ни у кого нет идей?
09 Январь 2017, 08:57:39
Ответ #43
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Перепробовал снова все ваши рекомендации. Все также передает нули.
13 Январь 2017, 13:33:42
Ответ #44
  • Новичок
  • *
  • Сообщений: 27
  • Репутация: +0/-0
  • Сообщество PrestaShop
    • Просмотр профиля
Неужели в prestashop так все сложно с добавлением новых полей?