From 38b887ff58c0f1fd8b1c7ccafbbd33640a2bffbb Mon Sep 17 00:00:00 2001 From: Nibz Date: Sun, 26 Jul 2015 14:16:05 +0200 Subject: [PATCH] 1.7.2 --- add.php | 131 ++ add_item.php | 46 + backend.css | 461 +++++ backend.js | 75 + backend_body.js | 211 +++ check_vat.php | 65 + config.php | 88 + delete.php | 46 + delete_attribute.php | 48 + delete_item.php | 72 + delete_item_attribute.php | 48 + delete_option.php | 49 + delete_order.php | 48 + eu_tax_zone.php | 34 + frontend.css | 483 +++++ frontend.js | 81 + help.php | 938 ++++++++++ images/ajax-loader.gif | Bin 0 -> 1456 bytes images/amex.gif | Bin 0 -> 645 bytes images/box_bg.png | Bin 0 -> 943 bytes images/checkout_steps/index.php | 20 + images/checkout_steps/step_1.png | Bin 0 -> 911 bytes images/checkout_steps/step_2.png | Bin 0 -> 982 bytes images/checkout_steps/step_3.png | Bin 0 -> 1013 bytes images/dd_grip.png | Bin 0 -> 38596 bytes images/delete.gif | Bin 0 -> 577 bytes images/discover.gif | Bin 0 -> 495 bytes images/email.png | Bin 0 -> 756 bytes images/email0.png | Bin 0 -> 558 bytes images/email1.png | Bin 0 -> 556 bytes images/error.gif | Bin 0 -> 1166 bytes images/in_stock.gif | Bin 0 -> 1125 bytes images/index.php | 20 + images/information.gif | Bin 0 -> 966 bytes images/loader.gif | Bin 0 -> 3208 bytes images/logo.gif | Bin 0 -> 15584 bytes images/logo.jpg | Bin 0 -> 11413 bytes images/mastercard.gif | Bin 0 -> 808 bytes images/nopic.png | Bin 0 -> 2967 bytes images/out_of_stock.gif | Bin 0 -> 733 bytes images/print.gif | Bin 0 -> 399 bytes images/short_of_stock.gif | Bin 0 -> 1135 bytes images/status/alert.gif | Bin 0 -> 161 bytes images/status/archived.gif | Bin 0 -> 82 bytes images/status/busy.gif | Bin 0 -> 229 bytes images/status/dunning.gif | Bin 0 -> 82 bytes images/status/index.php | 20 + images/status/invoice.gif | Bin 0 -> 82 bytes images/status/ordered.gif | Bin 0 -> 82 bytes images/status/paid.gif | Bin 0 -> 82 bytes images/status/reminder.gif | Bin 0 -> 82 bytes images/status/shipped.gif | Bin 0 -> 82 bytes images/success.gif | Bin 0 -> 1154 bytes images/transparent.gif | Bin 0 -> 43 bytes images/visa.gif | Bin 0 -> 335 bytes index.php | 20 + info.php | 665 +++++++ install.php | 277 +++ jquery/calc_price.js | 71 + jquery/index.php | 20 + jquery/jquery-1.7.2.min.js | 4 + languages/CS.php | 1 + languages/DE.php | 283 +++ languages/EN-GB.php | 301 ++++ languages/EN.php | 289 +++ languages/FR.php | 284 +++ languages/IT.php | 283 +++ languages/NL.php | 284 +++ languages/countries/DE.php | 219 +++ languages/countries/EN.php | 219 +++ languages/countries/FR.php | 269 +++ languages/countries/IT.php | 219 +++ languages/countries/NL.php | 269 +++ languages/countries/index.php | 20 + languages/index.php | 20 + languages/states/AT.php | 44 + languages/states/AU.php | 44 + languages/states/CA.php | 48 + languages/states/CH.php | 61 + languages/states/DE.php | 51 + languages/states/FR.php | 61 + languages/states/GB.php | 277 +++ languages/states/IT.php | 258 +++ languages/states/US.php | 86 + languages/states/index.php | 20 + library/premailer.php | 198 ++ lightbox2/css/index.php | 20 + lightbox2/css/lightbox.css | 181 ++ lightbox2/images/close.png | Bin 0 -> 498 bytes lightbox2/images/index.php | 20 + lightbox2/images/loading.gif | Bin 0 -> 8476 bytes lightbox2/images/next.png | Bin 0 -> 1359 bytes lightbox2/images/prev.png | Bin 0 -> 1368 bytes lightbox2/index.php | 20 + lightbox2/js/index.php | 20 + lightbox2/js/lightbox.js | 347 ++++ mini_cart.php | 172 ++ modify.php | 211 +++ modify_general_settings.php | 396 ++++ modify_item.php | 629 +++++++ modify_options.php | 228 +++ modify_orders.php | 274 +++ modify_page_settings.php | 276 +++ modify_payment_methods.php | 278 +++ move_down.php | 46 + move_dragdrop.php | 56 + move_img_down.php | 47 + move_img_up.php | 47 + move_up.php | 46 + payment_methods/advance/check_payment.php | 28 + payment_methods/advance/gateway.php | 60 + payment_methods/advance/icon.png | Bin 0 -> 732 bytes payment_methods/advance/index.php | 20 + payment_methods/advance/info.php | 46 + payment_methods/advance/languages/DE.php | 92 + payment_methods/advance/languages/EN.php | 95 + payment_methods/advance/languages/FR.php | 93 + payment_methods/advance/languages/IT.php | 95 + payment_methods/advance/languages/NL.php | 95 + payment_methods/advance/languages/index.php | 20 + payment_methods/cod/check_payment.php | 28 + payment_methods/cod/gateway.php | 73 + payment_methods/cod/icon.png | Bin 0 -> 806 bytes payment_methods/cod/index.php | 20 + payment_methods/cod/info.php | 46 + payment_methods/cod/languages/DE.php | 93 + payment_methods/cod/languages/EN.php | 96 + payment_methods/cod/languages/NL.php | 96 + payment_methods/cod/languages/index.php | 20 + payment_methods/index.php | 20 + payment_methods/invoice/check_payment.php | 28 + payment_methods/invoice/gateway.php | 60 + payment_methods/invoice/icon.png | Bin 0 -> 807 bytes payment_methods/invoice/index.php | 20 + payment_methods/invoice/info.php | 46 + payment_methods/invoice/languages/DE.php | 148 ++ payment_methods/invoice/languages/EN.php | 148 ++ payment_methods/invoice/languages/FR.php | 147 ++ payment_methods/invoice/languages/IT.php | 148 ++ payment_methods/invoice/languages/NL.php | 146 ++ payment_methods/invoice/languages/index.php | 20 + payment_methods/load.php | 123 ++ .../payment-network/check_payment.php | 51 + payment_methods/payment-network/gateway.php | 73 + payment_methods/payment-network/icon.png | Bin 0 -> 387 bytes payment_methods/payment-network/index.php | 20 + payment_methods/payment-network/info.php | 68 + .../payment-network/languages/DE.php | 118 ++ .../payment-network/languages/EN.php | 121 ++ .../payment-network/languages/NL.php | 121 ++ .../payment-network/languages/index.php | 20 + payment_methods/payment-network/logo.png | Bin 0 -> 1968 bytes payment_methods/payment-network/logo_de.png | Bin 0 -> 2416 bytes payment_methods/payment-network/post_data.php | 90 + payment_methods/payment-network/report.php | 100 ++ payment_methods/paypal/check_payment.php | 199 ++ payment_methods/paypal/gateway.php | 71 + payment_methods/paypal/icon.png | Bin 0 -> 670 bytes payment_methods/paypal/index.php | 20 + payment_methods/paypal/info.php | 63 + payment_methods/paypal/ipn.log | 0 payment_methods/paypal/ipn.php | 241 +++ payment_methods/paypal/languages/DE.php | 119 ++ payment_methods/paypal/languages/EN.php | 123 ++ payment_methods/paypal/languages/IT.php | 123 ++ payment_methods/paypal/languages/NL.php | 122 ++ payment_methods/paypal/languages/index.php | 20 + payment_methods/paypal/post_data.php | 137 ++ pngthumb.php | 59 + precheck.php | 53 + resize_img.php | 102 ++ save_attribute.php | 55 + save_form.php | 197 ++ save_general_settings.php | 150 ++ save_item.php | 617 +++++++ save_option.php | 53 + save_orders.php | 41 + save_page_settings.php | 87 + save_payment_methods.php | 66 + save_stock.php | 49 + search.php | 118 ++ send_invoice.php | 202 +++ stock.php | 186 ++ templates/cart/empty.htm | 7 + templates/cart/error.htm | 10 + templates/cart/index.php | 20 + templates/cart/success.htm | 4 + templates/cart/table_body.htm | 11 + templates/cart/table_footer.htm | 25 + templates/cart/table_header.htm | 20 + templates/cart/title.htm | 2 + templates/confirmation/canceled.htm | 8 + templates/confirmation/email_error.htm | 4 + templates/confirmation/error.htm | 8 + templates/confirmation/index.php | 20 + templates/confirmation/pending.htm | 6 + templates/confirmation/success.htm | 6 + templates/form/error.htm | 7 + templates/form/form.htm | 113 ++ templates/form/index.php | 20 + templates/form/title.htm | 8 + templates/index.php | 20 + templates/invoice/index.php | 20 + templates/invoice/table_body.htm | 10 + templates/invoice/table_footer.htm | 26 + templates/invoice/table_header.htm | 18 + templates/mini_cart/empty.htm | 14 + templates/mini_cart/index.php | 20 + templates/mini_cart/summary.htm | 22 + templates/pay_methods/error.htm | 2 + templates/pay_methods/footer.htm | 3 + templates/pay_methods/index.php | 20 + templates/pay_methods/title.htm | 36 + templates/summary/address.htm | 30 + templates/summary/err_agree_tac.htm | 12 + templates/summary/err_empty_cart.htm | 7 + templates/summary/free_shipping.htm | 4 + templates/summary/index.php | 20 + templates/summary/pay_method.htm | 9 + templates/summary/table_body.htm | 12 + templates/summary/table_footer.htm | 51 + templates/summary/table_header.htm | 17 + uninstall.php | 55 + upgrade.php | 1594 +++++++++++++++++ view.php | 588 ++++++ view_cart.php | 283 +++ view_confirmation.php | 251 +++ view_form.php | 479 +++++ view_invoice.php | 150 ++ view_item.php | 334 ++++ view_order.php | 154 ++ view_overview.php | 301 ++++ view_pay_methods.php | 108 ++ view_summary.php | 946 ++++++++++ 234 files changed, 23603 insertions(+) create mode 100644 add.php create mode 100644 add_item.php create mode 100644 backend.css create mode 100644 backend.js create mode 100755 backend_body.js create mode 100644 check_vat.php create mode 100644 config.php create mode 100644 delete.php create mode 100644 delete_attribute.php create mode 100644 delete_item.php create mode 100644 delete_item_attribute.php create mode 100644 delete_option.php create mode 100644 delete_order.php create mode 100644 eu_tax_zone.php create mode 100644 frontend.css create mode 100644 frontend.js create mode 100644 help.php create mode 100755 images/ajax-loader.gif create mode 100644 images/amex.gif create mode 100755 images/box_bg.png create mode 100644 images/checkout_steps/index.php create mode 100644 images/checkout_steps/step_1.png create mode 100644 images/checkout_steps/step_2.png create mode 100644 images/checkout_steps/step_3.png create mode 100644 images/dd_grip.png create mode 100644 images/delete.gif create mode 100644 images/discover.gif create mode 100644 images/email.png create mode 100755 images/email0.png create mode 100755 images/email1.png create mode 100644 images/error.gif create mode 100644 images/in_stock.gif create mode 100644 images/index.php create mode 100644 images/information.gif create mode 100644 images/loader.gif create mode 100644 images/logo.gif create mode 100644 images/logo.jpg create mode 100644 images/mastercard.gif create mode 100755 images/nopic.png create mode 100644 images/out_of_stock.gif create mode 100644 images/print.gif create mode 100644 images/short_of_stock.gif create mode 100644 images/status/alert.gif create mode 100644 images/status/archived.gif create mode 100644 images/status/busy.gif create mode 100644 images/status/dunning.gif create mode 100644 images/status/index.php create mode 100644 images/status/invoice.gif create mode 100644 images/status/ordered.gif create mode 100644 images/status/paid.gif create mode 100644 images/status/reminder.gif create mode 100644 images/status/shipped.gif create mode 100644 images/success.gif create mode 100644 images/transparent.gif create mode 100644 images/visa.gif create mode 100644 index.php create mode 100644 info.php create mode 100644 install.php create mode 100644 jquery/calc_price.js create mode 100644 jquery/index.php create mode 100644 jquery/jquery-1.7.2.min.js create mode 100644 languages/CS.php create mode 100644 languages/DE.php create mode 100644 languages/EN-GB.php create mode 100644 languages/EN.php create mode 100644 languages/FR.php create mode 100644 languages/IT.php create mode 100644 languages/NL.php create mode 100644 languages/countries/DE.php create mode 100644 languages/countries/EN.php create mode 100644 languages/countries/FR.php create mode 100644 languages/countries/IT.php create mode 100644 languages/countries/NL.php create mode 100644 languages/countries/index.php create mode 100644 languages/index.php create mode 100644 languages/states/AT.php create mode 100755 languages/states/AU.php create mode 100644 languages/states/CA.php create mode 100644 languages/states/CH.php create mode 100644 languages/states/DE.php create mode 100644 languages/states/FR.php create mode 100644 languages/states/GB.php create mode 100755 languages/states/IT.php create mode 100644 languages/states/US.php create mode 100644 languages/states/index.php create mode 100644 library/premailer.php create mode 100644 lightbox2/css/index.php create mode 100644 lightbox2/css/lightbox.css create mode 100644 lightbox2/images/close.png create mode 100644 lightbox2/images/index.php create mode 100644 lightbox2/images/loading.gif create mode 100644 lightbox2/images/next.png create mode 100644 lightbox2/images/prev.png create mode 100644 lightbox2/index.php create mode 100644 lightbox2/js/index.php create mode 100644 lightbox2/js/lightbox.js create mode 100644 mini_cart.php create mode 100755 modify.php create mode 100644 modify_general_settings.php create mode 100644 modify_item.php create mode 100644 modify_options.php create mode 100644 modify_orders.php create mode 100644 modify_page_settings.php create mode 100644 modify_payment_methods.php create mode 100644 move_down.php create mode 100755 move_dragdrop.php create mode 100644 move_img_down.php create mode 100644 move_img_up.php create mode 100644 move_up.php create mode 100644 payment_methods/advance/check_payment.php create mode 100644 payment_methods/advance/gateway.php create mode 100644 payment_methods/advance/icon.png create mode 100644 payment_methods/advance/index.php create mode 100644 payment_methods/advance/info.php create mode 100644 payment_methods/advance/languages/DE.php create mode 100644 payment_methods/advance/languages/EN.php create mode 100644 payment_methods/advance/languages/FR.php create mode 100644 payment_methods/advance/languages/IT.php create mode 100644 payment_methods/advance/languages/NL.php create mode 100644 payment_methods/advance/languages/index.php create mode 100644 payment_methods/cod/check_payment.php create mode 100644 payment_methods/cod/gateway.php create mode 100755 payment_methods/cod/icon.png create mode 100644 payment_methods/cod/index.php create mode 100644 payment_methods/cod/info.php create mode 100644 payment_methods/cod/languages/DE.php create mode 100644 payment_methods/cod/languages/EN.php create mode 100644 payment_methods/cod/languages/NL.php create mode 100644 payment_methods/cod/languages/index.php create mode 100644 payment_methods/index.php create mode 100644 payment_methods/invoice/check_payment.php create mode 100644 payment_methods/invoice/gateway.php create mode 100644 payment_methods/invoice/icon.png create mode 100644 payment_methods/invoice/index.php create mode 100644 payment_methods/invoice/info.php create mode 100644 payment_methods/invoice/languages/DE.php create mode 100644 payment_methods/invoice/languages/EN.php create mode 100644 payment_methods/invoice/languages/FR.php create mode 100644 payment_methods/invoice/languages/IT.php create mode 100644 payment_methods/invoice/languages/NL.php create mode 100644 payment_methods/invoice/languages/index.php create mode 100644 payment_methods/load.php create mode 100644 payment_methods/payment-network/check_payment.php create mode 100644 payment_methods/payment-network/gateway.php create mode 100644 payment_methods/payment-network/icon.png create mode 100644 payment_methods/payment-network/index.php create mode 100644 payment_methods/payment-network/info.php create mode 100644 payment_methods/payment-network/languages/DE.php create mode 100644 payment_methods/payment-network/languages/EN.php create mode 100644 payment_methods/payment-network/languages/NL.php create mode 100644 payment_methods/payment-network/languages/index.php create mode 100644 payment_methods/payment-network/logo.png create mode 100644 payment_methods/payment-network/logo_de.png create mode 100644 payment_methods/payment-network/post_data.php create mode 100644 payment_methods/payment-network/report.php create mode 100644 payment_methods/paypal/check_payment.php create mode 100644 payment_methods/paypal/gateway.php create mode 100644 payment_methods/paypal/icon.png create mode 100644 payment_methods/paypal/index.php create mode 100644 payment_methods/paypal/info.php create mode 100644 payment_methods/paypal/ipn.log create mode 100644 payment_methods/paypal/ipn.php create mode 100644 payment_methods/paypal/languages/DE.php create mode 100644 payment_methods/paypal/languages/EN.php create mode 100644 payment_methods/paypal/languages/IT.php create mode 100644 payment_methods/paypal/languages/NL.php create mode 100644 payment_methods/paypal/languages/index.php create mode 100644 payment_methods/paypal/post_data.php create mode 100644 pngthumb.php create mode 100644 precheck.php create mode 100644 resize_img.php create mode 100644 save_attribute.php create mode 100644 save_form.php create mode 100644 save_general_settings.php create mode 100644 save_item.php create mode 100644 save_option.php create mode 100644 save_orders.php create mode 100644 save_page_settings.php create mode 100644 save_payment_methods.php create mode 100644 save_stock.php create mode 100644 search.php create mode 100644 send_invoice.php create mode 100644 stock.php create mode 100644 templates/cart/empty.htm create mode 100644 templates/cart/error.htm create mode 100644 templates/cart/index.php create mode 100644 templates/cart/success.htm create mode 100644 templates/cart/table_body.htm create mode 100644 templates/cart/table_footer.htm create mode 100644 templates/cart/table_header.htm create mode 100644 templates/cart/title.htm create mode 100644 templates/confirmation/canceled.htm create mode 100644 templates/confirmation/email_error.htm create mode 100644 templates/confirmation/error.htm create mode 100644 templates/confirmation/index.php create mode 100644 templates/confirmation/pending.htm create mode 100644 templates/confirmation/success.htm create mode 100644 templates/form/error.htm create mode 100644 templates/form/form.htm create mode 100644 templates/form/index.php create mode 100644 templates/form/title.htm create mode 100644 templates/index.php create mode 100644 templates/invoice/index.php create mode 100644 templates/invoice/table_body.htm create mode 100644 templates/invoice/table_footer.htm create mode 100644 templates/invoice/table_header.htm create mode 100644 templates/mini_cart/empty.htm create mode 100644 templates/mini_cart/index.php create mode 100644 templates/mini_cart/summary.htm create mode 100644 templates/pay_methods/error.htm create mode 100644 templates/pay_methods/footer.htm create mode 100644 templates/pay_methods/index.php create mode 100644 templates/pay_methods/title.htm create mode 100644 templates/summary/address.htm create mode 100644 templates/summary/err_agree_tac.htm create mode 100644 templates/summary/err_empty_cart.htm create mode 100644 templates/summary/free_shipping.htm create mode 100644 templates/summary/index.php create mode 100644 templates/summary/pay_method.htm create mode 100644 templates/summary/table_body.htm create mode 100644 templates/summary/table_footer.htm create mode 100644 templates/summary/table_header.htm create mode 100644 uninstall.php create mode 100644 upgrade.php create mode 100644 view.php create mode 100644 view_cart.php create mode 100644 view_confirmation.php create mode 100644 view_form.php create mode 100644 view_invoice.php create mode 100644 view_item.php create mode 100644 view_order.php create mode 100644 view_overview.php create mode 100644 view_pay_methods.php create mode 100644 view_summary.php diff --git a/add.php b/add.php new file mode 100644 index 0000000..d6dbda2 --- /dev/null +++ b/add.php @@ -0,0 +1,131 @@ +add_slashes('
+
+ +
+
+ + +'); +$item_loop = $admin->add_slashes(''); +$footer = $admin->add_slashes(' +
+[THUMB] +
+[TITLE] +
+[DESCRIPTION] +
+[TXT_PRICE]: [CURRENCY] [PRICE] +
+[TXT_STOCK]: [STOCK] +
+
+[OPTION] +
+ + +
+
+ + + + + + + + + +

[PREVIOUS_PAGE_LINK][TXT_ITEM] [OF] [NEXT_PAGE_LINK]
'); +$item_header = $admin->add_slashes('
'); +$item_footer = $admin->add_slashes('[IMAGE] +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +[OPTION] + + + + +

[TITLE]

[TXT_SKU]:[SKU]
[TXT_PRICE]:[CURRENCY] [PRICE]
[TXT_SHIPPING]:[CURRENCY] [SHIPPING]
[TXT_STOCK]:[STOCK]

[TXT_FULL_DESC]:

[FULL_DESC]
[TXT_SHIPPING_COST]: +[TXT_DOMESTIC]: [CURRENCY] [SHIPPING_DOMESTIC]
+[TXT_ABROAD]: [CURRENCY] [SHIPPING_ABROAD]
+ + +
+
+[PREVIOUS] | [TXT_BACK] | [NEXT] +
+
'); + + +// Insert default values into table page_settings +$database->query("INSERT INTO ".TABLE_PREFIX."mod_bakery_page_settings (section_id, page_id, page_offline, offline_text, continue_url, header, item_loop, footer, item_header, item_footer) +VALUES ('$section_id', '$page_id', '$page_offline', '$offline_text', '$continue_url', '$header', '$item_loop', '$footer', '$item_header', '$item_footer')"); diff --git a/add_item.php b/add_item.php new file mode 100644 index 0000000..6718021 --- /dev/null +++ b/add_item.php @@ -0,0 +1,46 @@ +get_new($section_id); + +// Insert new row into database +$database->query("INSERT INTO ".TABLE_PREFIX."mod_bakery_items (section_id,page_id,active,position,created_when,created_by) VALUES ('$section_id','$page_id','1','$position','".@mktime()."','".$admin->get_user_id()."')"); + +// Get the id +$item_id = $database->get_one("SELECT LAST_INSERT_ID()"); + +// Say that a new record has been added, then redirect to modify page +if ($database->is_error()) { + $admin->print_error($database->get_error(), WB_URL.'/modules/bakery/modify_item.php?page_id='.$page_id.'§ion_id='.$section_id.'&item_id='.$item_id); +} else { + $admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/bakery/modify_item.php?page_id='.$page_id.'§ion_id='.$section_id.'&item_id='.$item_id.'&from=add_item'); +} + +// Print admin footer +$admin->print_footer(); \ No newline at end of file diff --git a/backend.css b/backend.css new file mode 100644 index 0000000..4590104 --- /dev/null +++ b/backend.css @@ -0,0 +1,461 @@ +/* + Module developed for the Open Source Content Management System WebsiteBaker (http://websitebaker.org) + Copyright (C) 2007 - 2015, Christoph Marti + + LICENCE TERMS: + This module is free software. You can redistribute it and/or modify it + under the terms of the GNU General Public License - version 2 or later, + as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html. + + DISCLAIMER: + This module is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +*/ + + +/* Backend Stylesheet Module Bakery */ +/* ******************************** */ + +/* +NOTE: +Modify the HTML of the main page and the item page in the layout section of the Bakery page settings. +Modify the HTML of the invoice template in the layout section of the Bakery payment methods > select invoice. +Modify the CSS of the main page and the item page in the frontend stylesheet. +Modify the CSS of the invoice template and the view order in this stylesheet. +*/ + + + +/* INVOICE PRINT */ + +/* General */ +#invoice { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 14px; + color: #000000; + margin: 0px; + background-color: #FFFFFF; + padding: 20px; + text-align: left; + vertical-align: top; +} +#button { + margin-bottom: 25px; +} +#invoice hr { + margin: 0; + border: 0; + border-top: 1px solid #A0A0A0; + height: 1px; +} +#invoice h1 { + text-align: left; + font-size: 20px; + text-transform: uppercase; +} +#invoice h2 { + font-size: 15px; + margin: 5px 0px 5px 0px; + float: left; +} +#invoice .mod_bakery_logo_b { + text-align: center; +} +#invoice .mod_bakery_shop_address_b { + text-align: center; + letter-spacing: 0.3em; +} +#invoice .mod_bakery_cust_address_b { + +} +#invoice p.mod_bakery_invoice_no_b { + font-size: 11px; + text-align: right; + margin-right: 19px; +} +#invoice table.mod_bakery_invoice_no_b { + width: 45%; + float: right; + margin-bottom: 20px; + border: none; + font-size: 12px; +} +#invoice table.mod_bakery_invoice_no_b td:first-child { + font-weight: bold; + padding-right: 12px; +} +#invoice .mod_bakery_thank_you_b { + font-size: 15px; + margin: 5px 0px 5px 0px; +} +#invoice .mod_bakery_pay_invoice_b { + font-size: 15px; + margin: 5px 0px 5px 0px; +} +#invoice .mod_bakery_bank_account_b { + font-size: 12px; + margin-left: 20px; +} + + + + +/* VIEW ORDER */ + +/* General */ +#order table { + font-family: Arial, Helvetica, sans-serif; + font-size: 11px; + border: 1px dotted #BCBCBC; + margin: 0 auto; +} +#order hr { + margin: 0; + border: 0; + border-top: 1px dotted #BCBCBC; + height: 1px; +} +#order .mod_bakery_order_b { + font-weight: bold; + margin-left: 12px; +} +#order .mod_bakery_address_b { + font-weight: bold; +} +#order .mod_bakery_tax_no_b { + font-weight: bold; +} + + + + +/* INVOICE PRINT and VIEW ORDER */ + +/* Error */ +.mod_bakery_error_b { + width: 260px; + margin: 150px auto; + padding: 15px 0; + text-align: center; + color: red; + border: solid 1px red; + background-color: #FFDCD9; + background-image: url(images/error.gif); + background-position: 15px center; + background-repeat: no-repeat; +} + +/* INVOICE table header */ +.mod_bakery_invoice_th_sku_b { + text-align: left; +} +.mod_bakery_invoice_th_name_b { + text-align: center; +} +.mod_bakery_invoice_th_quantity_b { + text-align: right; +} +.mod_bakery_invoice_th_price_b { + text-align: right; +} +.mod_bakery_invoice_th_shipping_b { + text-align: right; +} +.mod_bakery_invoice_th_tax_rate_b { + text-align: right; +} +.mod_bakery_invoice_th_sum_b { + text-align: right; +} + +/* INVOICE table body */ +.mod_bakery_invoice_td_sku_b { + text-align: left; + width: 10%; +} +.mod_bakery_invoice_td_name_b { + text-align: center; +} +.mod_bakery_invoice_td_quantity_b { + text-align: right; + width: 12%; +} +.mod_bakery_invoice_td_price_b { + text-align: right; + width: 12%; +} +.mod_bakery_invoice_td_shipping_b { + text-align: right; + width: 12%; +} +.mod_bakery_invoice_td_tax_rate_b { + text-align: right; + width: 5%; +} +.mod_bakery_invoice_td_sum_b { + text-align: right; + width: 20%; +} + +/* INVOICE table details */ +.mod_bakery_invoice_currency_b { + font-size: 9px; + font-weight: normal; +} +.mod_bakery_invoice_tax_rate_b { + font-size: 9px; + font-weight: normal; +} +.mod_bakery_invoice_item_b { + font-weight: bold; +} +.mod_bakery_invoice_subtotal_b { + text-align: right; + font-weight: bold; + line-height: 200%; +} +.mod_bakery_invoice_shipping_b { + text-align: right; + font-weight: bold; + line-height: 75%; +} +.mod_bakery_invoice_free_shipping_b { + text-align: right; + font-weight: bold; + line-height: 75%; + color: #FF0000; +} +.mod_bakery_invoice_tax_b { + text-align: right; + font-weight: bold; + line-height: 75%; +} +.mod_bakery_invoice_total_b { + text-align: right; + font-weight: bold; + line-height: 300%; +} + +@media print { + #button { + display: none; + } +} + + + + +/* GENERAL */ + +/* Modify items navigation buttons */ +#mod_bakery_modify_b { + background-color: #fbfbfb; + background-image: url("images/box_bg.png"); + background-repeat: repeat-x; + background-position: 0 -40px; + margin-top: 8px; + margin-bottom: 8px; + padding: 4px; + border: solid 1px #bfc9df; +} +#mod_bakery_modify_b input { + color: #5c6a86; + font-size: 10px; + font-weight: bold; + background-color: #c5cdd6; + background-image: url("images/box_bg.png"); + background-position: 0 -40px; + border: solid 1px; +} +#mod_bakery_modify_b input:hover { + background-image: none; +} + + +/* Modify items drag&drop table */ +table.mod_bakery_dragndrop_b { + background-repeat: repeat-x; + margin-bottom: 5px; + border: solid 2px #babfca; +} +table.mod_bakery_dragndrop_b caption { + color: #fff !important; + font-size: 16px; + font-weight: bold; + line-height: 160%; + background-color: #515d76; + background-image: url("images/box_bg.png"); + background-repeat: repeat-x; + text-align: left; + margin-top: 8px; + padding-top: 4px; + padding-left: 10px; + height: 35px; + border: 1px #515d76; +} +table.mod_bakery_dragndrop_b thead td { + color: #4c576f; + font-weight: bold; + background-color: #fff; +} +table.mod_bakery_dragndrop_b tbody td { + border-bottom: 1px solid #bfc9df; +} +table.mod_bakery_dragndrop_b .hilite td { + background-color: #DBFBBA !important; +} +table.mod_bakery_dragndrop_b thead td, +table.mod_bakery_dragndrop_b tfoot td { + font-size: 11px; + background-image: url("images/box_bg.png"); + background-repeat: repeat-x; + background-attachment: scroll; + background-position: 0 -40px; + border-top: 1px solid #becadb; + border-bottom: 1px solid #becadb; +} + +/* Drag&drop specifics */ +table.mod_bakery_dragndrop_b .dragBakeryResult { + font-size: 8px; + font-family: Courier; + text-align: center; +} +table.mod_bakery_dragndrop_b .dragdrop_bakery { + background-color: #d5dde7; + width: 15px; +} +table.mod_bakery_dragndrop_b .dragdrop_handle { + background-color: #e9eef5; + background-image: url("images/dd_grip.png"); + background-position: center center; + cursor: move; + padding: 0; + width: 20px !important; + border-style: solid; + border-width: 2px 2px 3px; + border-color: #cad2d9 #bac5ce; +} +table.mod_bakery_dragndrop_b tr.irow_hover { + background-color: #ebf3ff; +} +table.mod_bakery_dragndrop_b .move_up, +table.mod_bakery_dragndrop_b .move_down { + width: 16px !important; +} +table.mod_bakery_dragndrop_b td.item_id { + width: 3%; + text-align: right; + font-size: 1.6em; +} + +/* Thumb tooltip */ +div.mod_bakery_thumbnail_b { + color: #babfca; + background-color: #fff; + text-align: center; + padding: 1px; + width: 48px; + height: 48px; + overflow: hidden; + border: solid 2px; +} +div.mod_bakery_thumbnail_b img { + position: relative; + left: 50%; + margin-left: -45px; +} +p#mod_bakery_preview_b { + color: #babfca; + background: #fff; + display: none; + padding: 6px; + position: absolute; + border: solid 2px; + -moz-box-shadow: 5px 5px 11px #585858; + -webkit-box-shadow: 5px 5px 11px #585858; + box-shadow: 5px 5px 11px #585858; +} + + +/* General */ +.row_a { + +} +.row_b { + background-color: #EBF3FF; +} +.row_a:hover, .row_b:hover { + background-color: #E8E8E8; +} +.mod_bakery_submit_row_b { + background-color: #C1D2EE; +} +.mod_bakery_section_header_b { + text-align: left; + padding: 20px 0 5px 10px; + background-color: #C1D2EE; +} +.mod_bakery_section_header_b span { + font-size: 12px; + font-weight: normal; +} +.mod_bakery_img_resize_table_b { + background-color: #E7F0F6; + border: 1px solid #CECECE; + margin: 5px; +} +.mod_bakery_disabled_b { + color: #9D9D9D; +} +input[type="submit"], input[type="button"] { + +} +input.mod_bakery_edit_css { + width: 200px; + float: right; + clear: both; +} + + + + +/* PLACEHOLDERS USED IN THE BAKERY TEMPLATES (help.php) */ + +#mod_bakery_placeholders_b { + border-collapse: collapse; +} +.mod_bakery_placeholders_header_b { + border: none; + background-color: #C1D2EE; +} +#mod_bakery_placeholders_b th { + background-color: #DBEBF2; + border: 1px solid #E1E1E1; +} +#mod_bakery_placeholders_b td { + border: 1px solid #E1E1E1; +} +.mod_bakery_placeholders_column_b { + background-color: #ECF3F7; +} +.mod_bakery_placeholders_localisation_b { + color: #0000FF; +} +.mod_bakery_placeholders_general_settings_b { + color: #008000; +} +.mod_bakery_placeholders_page_settings_b { + color: #804000; +} +.mod_bakery_placeholders_customer_b { + color: #FF0000; +} +.mod_bakery_placeholders_items_b { + color: #FF6600; +} +.mod_bakery_placeholders_page_b { + color: #FF0099; +} diff --git a/backend.js b/backend.js new file mode 100644 index 0000000..4fa69cf --- /dev/null +++ b/backend.js @@ -0,0 +1,75 @@ +/* + Javascript routines for WebsiteBaker module Bakery + Copyright (C) 2007 - 2015, Christoph Marti + + This Javascript routines are free software. You can redistribute it and/or modify it + under the terms of the GNU General Public License - version 2 or later, + as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html. + + The Javascript routines are distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +*/ + + + +// ********************************************************************************** +// Function to change the checkbox status at the same time +// for all checkboxes having the same name like the clicked one +// ********************************************************************************** + +function sync_checkboxes(clicked_checkbox) { + + // Get all checkboxes with the same name + var checkboxes = document.getElementsByName(clicked_checkbox.name); + // Get state of clicked checkbox and define new state for all checkboxes + var new_state = false; + if (clicked_checkbox.checked == true) { + new_state = true; + } + // Loop through all checkboxes and set new state + for (var i = 0; i < checkboxes.length; ++i) { + if (checkboxes[i].type == "checkbox") { + checkboxes[i].checked = new_state; + } + } +} + + + +// ********************************************************************************** +// Function to add and remove file type inputs +// (http://codingforums.com/showthread.php?t=65390) +// ********************************************************************************** + +function addFile(delTxt) { + var root = document.getElementById('upload').getElementsByTagName('tr')[0].parentNode; + var oR = cE('tr'); + var oC = cE('td'); + var oI = cE('input'); + var oS = cE('span'); + cA(oI,'type','file'); + cA(oI,'name','image[]'); + oS.style.cursor = 'pointer'; + + oS.onclick = function() { + this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); + } + + oS.appendChild(document.createTextNode(delTxt)); + oC.appendChild(oI); + oC.appendChild(oS); + oR.appendChild(oC); + root.appendChild(oR); +} + +function cE(el){ + this.obj = document.createElement(el); + return this.obj; +} + +function cA(obj,att,val) { + obj.setAttribute(att,val); + return; +} diff --git a/backend_body.js b/backend_body.js new file mode 100755 index 0000000..9356bd8 --- /dev/null +++ b/backend_body.js @@ -0,0 +1,211 @@ +(function($){ +/* + * includeMany 1.2.2 + * + * Copyright (c) 2009 Arash Karimzadeh (arashkarimzadeh.com) + * Licensed under the MIT (MIT-LICENSE.txt) + * http://www.opensource.org/licenses/mit-license.php + * http://www.arashkarimzadeh.com/jquery/17-includemany-jquery-include-many.html + * + * Date: Dec 03 2009 + */ +$.chainclude = function(urls,finaly){ + var onload = function(callback,data){ + if(typeof urls.length!='undefined'){ + if(urls.length==0) + return $.isFunction(finaly) + ?finaly(data) + :null; + urls.shift(); + return $.chainclude.load(urls,onload); + } + for(var item in urls){ + urls[item](data); + delete urls[item]; + var count = 0; + for(var i in urls) + count++; + return (count==0) + ?$.isFunction(finaly)?finaly(data):null + :$.chainclude.load(urls,onload); + } + } + $.chainclude.load(urls,onload); +}; +$.chainclude.load = function(urls,onload){ + if(typeof urls=='object' && typeof urls.length=='undefined') + for(var item in urls) + return $.include.load(item,onload,urls[item].callback); + urls = $.makeArray(urls); + $.include.load(urls[0],onload,null); +}; +$.include = function(urls,finaly){ + var luid = $.include.luid++; + var onload = function(callback,data){ + if($.isFunction(callback)) + callback(data); + if(--$.include.counter[luid]==0&&$.isFunction(finaly)) + finaly(); + } + if(typeof urls=='object' && typeof urls.length=='undefined'){ + $.include.counter[luid] = 0; + for(var item in urls) + $.include.counter[luid]++; + return $.each(urls,function(url,callback){$.include.load(url,onload,callback);}); + } + urls = $.makeArray(urls); + $.include.counter[luid] = urls.length; + $.each(urls,function(){$.include.load(this,onload,null);}); +} +$.extend( + $.include, + { + luid: 0, + counter: [], + load: function(url,onload,callback){ + url = url.toString(); + if($.include.exist(url)) + return onload(callback); + if(/.css$/.test(url)) + $.include.loadCSS(url,onload,callback); + else if(/.js$/.test(url)) + $.include.loadJS(url,onload,callback); + else + $.get(url,function(data){onload(callback,data)}); + }, + loadCSS: function(url,onload,callback){ + var css=document.createElement('link'); + css.setAttribute('type','text/css'); + css.setAttribute('rel','stylesheet'); + css.setAttribute('href',''+url); + $('head').get(0).appendChild(css); + $.browser.msie + ?$.include.IEonload(css,onload,callback) + :onload(callback);//other browsers do not support it + }, + loadJS: function(url,onload,callback){ + var js=document.createElement('script'); + js.setAttribute('type','text/javascript'); + js.setAttribute('src',''+url); + $.browser.msie + ?$.include.IEonload(js,onload,callback) + :js.onload = function(){onload(callback)}; + $('head').get(0).appendChild(js); + }, + IEonload: function(elm,onload,callback){ + elm.onreadystatechange = + function(){ + if(this.readyState=='loaded'||this.readyState=='complete') + onload(callback); + } + }, + exist: function(url){ + var fresh = false; + $('head script').each( + function(){ + if(/.css$/.test(url)&&this.href==url) + return fresh=true; + else if(/.js$/.test(url)&&this.src==url) + return fresh=true; + } + ); + return fresh; + } + } +); +// +})(jQuery); + + + + + +if(!jQuery().sortable){ + // load_jQ_UI; + $.include('../../include/jquery/jquery-ui-min.js'); +} + +$(window).load(function(){ + + // load jQuery UI if sortable not loaded + + if(jQuery().sortable){ + + + /** + Drag&Drop + */ + $(function() { + // This class="dragdrop_bakery" will result in class="dragdrop_bakery dragdrop_handle" + $('.dragdrop_bakery').addClass('dragdrop_handle'); + // Remove up/down icons (we have drag&drop therefore we don't need them) + $(".move_up a,.move_down a").fadeOut(1); + + $("#dragBakeryTable").sortable({ + appendTo: 'body', + handle: '.dragdrop_handle', + opacity: 0.8, + cursor: 'move', + update: function() { + var order = $(this).sortable("serialize") + '&action=updatePosition'; + $.post("../../modules/bakery/move_dragdrop.php", order, function(acknowledgement){ + //$("#dragBakeryTable tr").removeClass('hilite'); + $("#dragBakeryResult").html(acknowledgement).fadeIn("slow"); + $("#dragBakeryResult").fadeOut(3500); + }); + } + }) + }); + + }//endif + + /* + hover effect for item rows + */ + $("tr.irow") + .mouseover(function(){ + $(this).addClass("irow_hover"); + }) + .mouseout(function(){ + $(this).removeClass("irow_hover"); + }); + +}); //window.load + + + + + +/** + Image preview script + written by Alen Grakalic (http://cssglobe.com) + for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery +*/ + +this.imagePreview = function(){ + $('div.mod_bakery_thumbnail_b a.internal').addClass('preview'); + $("a.preview").hover(function(e){ + this.t = this.title; + this.title = ""; + var c = (this.t != "") ? "
" + this.t : ""; + $("body").append("

Image preview"+ c +"

"); + $("#mod_bakery_preview_b") + .css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px").fadeIn("slow"); + }, + function(){ + this.title = this.t; + $("#mod_bakery_preview_b").remove(); + }); + $("a.preview").mousemove(function(e){ + $("#mod_bakery_preview_b") + .css("top",(e.pageY - xOffset) + "px").css("left",(e.pageX + yOffset) + "px"); + }); + +}; + +$(window).load(function(){ +// initialize Image preview script + xOffset = 100; + yOffset = 40; + imagePreview(); +}); //window.load \ No newline at end of file diff --git a/check_vat.php b/check_vat.php new file mode 100644 index 0000000..f46c08f --- /dev/null +++ b/check_vat.php @@ -0,0 +1,65 @@ + 1)); + $result = $soap->checkVat(array('countryCode' => $country_code, 'vatNumber' => $vat_no)); + } catch(SoapFault $E) { + echo '

'.$E->faultstring.'

'; + } + if (isset($result->valid) && !$result->valid) { + return false; + } + return true; +} diff --git a/config.php b/config.php new file mode 100644 index 0000000..06df847 --- /dev/null +++ b/config.php @@ -0,0 +1,88 @@ + [OPTION] placeholder +$use_table = TRUE; + +// On item detail pages chop long pagination links and add … (horizontal ellipsis) +// Number of allowed chars before chopping link text +$link_length = 24; + + + + +// IMAGES AND THUMBNAILS (BACKEND) +// ******************************* + +// Selectable thumbnail default sizes (modify page settings) +$default_thumb_sizes['40'] = '40x40px'; +$default_thumb_sizes['50'] = '50x50px'; +$default_thumb_sizes['60'] = '60x60px'; +$default_thumb_sizes['75'] = '75x75px'; +$default_thumb_sizes['100'] = '100x100px'; +$default_thumb_sizes['125'] = '125x125px'; +$default_thumb_sizes['150'] = '150x150px'; + +// Accepted max lenght of image filenames (modify item) +$filename_max_length = 40; + +// For item images set image resize default values (modify item) +$fetch_item['imgresize'] = ''; // yes = selected by default +$fetch_item['quality'] = 75; +$fetch_item['maxwidth'] = 400; +$fetch_item['maxheight'] = 300; + + + + + + diff --git a/delete.php b/delete.php new file mode 100644 index 0000000..79cc520 --- /dev/null +++ b/delete.php @@ -0,0 +1,46 @@ +query("SELECT item_id, link FROM ".TABLE_PREFIX."mod_bakery_items WHERE section_id = '$section_id'"); +if ($query_items->numRows() > 0) { + while ($item = $query_items->fetchRow()) { + // Delete item access file + if (is_writable(WB_PATH.PAGES_DIRECTORY.$item['link'].PAGE_EXTENSION)) { unlink(WB_PATH.PAGES_DIRECTORY.$item['link'].PAGE_EXTENSION); } + // Delete any images if they exists + $image = WB_PATH.MEDIA_DIRECTORY.'/bakery/images/item'.$item['item_id']; + $thumb = WB_PATH.MEDIA_DIRECTORY.'/bakery/thumbs/item'.$item['item_id']; + if (is_dir($image)) { rm_full_dir($image); } + if (is_dir($thumb)) { rm_full_dir($thumb); } + // Delete item attributes in db + $database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_item_attributes WHERE item_id = '{$item['item_id']}'"); + } +} + +// Delete items and page settings in db +$database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_items WHERE section_id = '$section_id'"); +$database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_page_settings WHERE section_id = '$section_id'"); diff --git a/delete_attribute.php b/delete_attribute.php new file mode 100644 index 0000000..ef849c6 --- /dev/null +++ b/delete_attribute.php @@ -0,0 +1,48 @@ +query("DELETE FROM ".TABLE_PREFIX."mod_bakery_attributes WHERE attribute_id = '$attribute_id'"); +$database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_item_attributes WHERE attribute_id = '$attribute_id'"); + + +// Check if there is a db error, otherwise say successful +if ($database->is_error()) { + $admin->print_error($database->get_error(), WB_URL.'/modules/bakery/modify_options.php?page_id='.$page_id); +} else { + $admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/bakery/modify_options.php?page_id='.$page_id); +} + +// Print admin footer +$admin->print_footer(); diff --git a/delete_item.php b/delete_item.php new file mode 100644 index 0000000..a6775d9 --- /dev/null +++ b/delete_item.php @@ -0,0 +1,72 @@ +query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_items WHERE item_id = '$item_id'"); +if ($query_details->numRows() > 0) { + $get_details = $query_details->fetchRow(); +} else { + $admin->print_error($TEXT['NOT_FOUND'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); +} + +// Unlink item access file +if (is_writable(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION)) { + unlink(WB_PATH.PAGES_DIRECTORY.$get_details['link'].PAGE_EXTENSION); +} + +// Delete any images if they exists +$image = WB_PATH.MEDIA_DIRECTORY.'/bakery/images/item'.$item_id; +$thumb = WB_PATH.MEDIA_DIRECTORY.'/bakery/thumbs/item'.$item_id; +if (is_dir($image)) { rm_full_dir($image); } +if (is_dir($thumb)) { rm_full_dir($thumb); } + +// Delete item +$database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_items WHERE item_id = '$item_id' LIMIT 1"); +$database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_item_attributes WHERE item_id = '$item_id'"); +$database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_images WHERE item_id = '$item_id'"); + +// Clean up ordering +require(WB_PATH.'/framework/class.order.php'); +$order = new order(TABLE_PREFIX.'mod_bakery_items', 'position', 'item_id', 'section_id'); +$order->clean($section_id); + +// Check if there is a db error, otherwise say successful +if ($database->is_error()) { + $admin->print_error($database->get_error(), WB_URL.'/modules/modify_post.php?page_id='.$page_id.'&item_id='.$item_id); +} else { + $admin->print_success($TEXT['SUCCESS'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id); +} + +// Print admin footer +$admin->print_footer(); diff --git a/delete_item_attribute.php b/delete_item_attribute.php new file mode 100644 index 0000000..b70b2b7 --- /dev/null +++ b/delete_item_attribute.php @@ -0,0 +1,48 @@ +query("DELETE FROM ".TABLE_PREFIX."mod_bakery_item_attributes WHERE item_id = '$item_id' AND attribute_id = '$attribute_id'"); + + +// Check if there is a db error, otherwise say successful +if ($database->is_error()) { + $admin->print_error($database->get_error(), WB_URL.'/modules/bakery/modify_item.php?page_id='.$page_id.'§ion_id='.$section_id.'&item_id='.$item_id.'#options'); +} else { + $admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/bakery/modify_item.php?page_id='.$page_id.'§ion_id='.$section_id.'&item_id='.$item_id.'#options'); +} + +// Print admin footer +$admin->print_footer(); diff --git a/delete_option.php b/delete_option.php new file mode 100644 index 0000000..ea37783 --- /dev/null +++ b/delete_option.php @@ -0,0 +1,49 @@ +query("DELETE FROM ".TABLE_PREFIX."mod_bakery_options WHERE option_id = '$option_id'"); +$database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_attributes WHERE option_id = '$option_id'"); +$database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_item_attributes WHERE option_id = '$option_id'"); + + +// Check if there is a db error, otherwise say successful +if ($database->is_error()) { + $admin->print_error($database->get_error(), WB_URL.'/modules/bakery/modify_options.php?page_id='.$page_id); +} else { + $admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/bakery/modify_options.php?page_id='.$page_id); +} + +// Print admin footer +$admin->print_footer(); diff --git a/delete_order.php b/delete_order.php new file mode 100644 index 0000000..42c6ff5 --- /dev/null +++ b/delete_order.php @@ -0,0 +1,48 @@ +query("DELETE FROM ".TABLE_PREFIX."mod_bakery_customer WHERE order_id = '$order_id'"); +$database->query("DELETE FROM ".TABLE_PREFIX."mod_bakery_order WHERE order_id = '$order_id'"); + + +// Check if there is a db error, otherwise say successful +if ($database->is_error()) { + $admin->print_error($database->get_error(), WB_URL.'/modules/bakery/modify_orders.php?page_id='.$page_id.'&view='.$_GET['view']); +} else { + $admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/bakery/modify_orders.php?page_id='.$page_id.'&view='.$_GET['view']); +} + +// Print admin footer +$admin->print_footer(); diff --git a/eu_tax_zone.php b/eu_tax_zone.php new file mode 100644 index 0000000..4a1837b --- /dev/null +++ b/eu_tax_zone.php @@ -0,0 +1,34 @@ + select invoice. +Modify the CSS of the main page and the item page in this stylesheet. +Modify the CSS of the invoice template and the view order in the backend stylesheet. +*/ + + +/* GENERAL */ + +.mod_bakery_h_f { + text-align: left; +} +.mod_bakery_ordernum_f { + font-weight: bold; +} +.mod_bakery_hr_f { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #C5C5C5; + margin: 1em 0; + padding: 0; +} + + +/* MAIN PAGE */ + +.mod_bakery_main_div_cart_bt_f { + text-align: left; +} +.mod_bakery_main_td_f { + text-align: center; +} +.mod_bakery_main_thumb_f { + border: none; +} +.mod_bakery_main_img_f { + border: none; +} +.mod_bakery_main_title_f { + font-weight: bold; +} +.mod_bakery_main_in_stock_f { + color: green; +} +.mod_bakery_main_short_of_stock_f { + color: orange; +} +.mod_bakery_main_out_of_stock_f { + color: red; +} +.mod_bakery_main_stock_img_f { + border: red 1px; +} +.mod_bakery_main_input_f { + text-align: right; +} +.mod_bakery_main_select_f { + width: 100px; +} + + +/* ITEM PAGE */ + +.mod_bakery_item_thumb_f { + border: none; +} +.mod_bakery_item_img_f { + border: none; +} +.mod_bakery_item_caption_f { + +} +.mod_bakery_item_table_f { + width: 75%; + text-align: left; +} +.mod_bakery_item_title_f { + font-weight: bold; +} +.mod_bakery_item_sku_f { + font-weight: bold; +} +.mod_bakery_item_stock_f { + font-weight: bold; +} +.mod_bakery_item_in_stock_f { + color: green; +} +.mod_bakery_item_short_of_stock_f { + color: orange; +} +.mod_bakery_item_out_of_stock_f { + color: red; +} +.mod_bakery_item_stock_img_f { + border: red 1px; +} +.mod_bakery_item_price_f { + font-weight: bold; +} +.mod_bakery_item_shipping_f { + font-weight: bold; +} +.mod_bakery_item_full_desc_f { + font-weight: bold; +} +.mod_bakery_shipping_cost_f { + font-weight: bold; +} +.mod_bakery_item_option_f { + font-weight: bold; +} +.mod_bakery_item_input_f { + text-align: right; +} +.mod_bakery_item_select_f { + +} + + +/* CART */ + +/* CART table header */ +.mod_bakery_cart_th_thumb_f { + text-align: left; +} +.mod_bakery_cart_th_sku_f { + text-align: right; + white-space: nowrap; +} +.mod_bakery_cart_th_name_f { + text-align: center; + width: 44%; +} +.mod_bakery_cart_th_quantity_f { + text-align: left; + white-space: nowrap; +} +.mod_bakery_cart_th_price_f { + text-align: right; + white-space: nowrap; +} +.mod_bakery_cart_th_shipping_f { + text-align: right; + white-space: nowrap; +} +.mod_bakery_cart_th_sum_f { + text-align: right; + width: 20%; +} + +/* CART table body */ +.mod_bakery_cart_td_thumb_f { + text-align: left; +} +.mod_bakery_cart_td_sku_f { + text-align: right; +} +.mod_bakery_cart_td_name_f { + text-align: center; +} +.mod_bakery_cart_td_quantity_f { + text-align: right; + white-space: nowrap; +} +.mod_bakery_cart_td_quantity_f a img { + margin-bottom: -3px; + border: none; +} +.mod_bakery_cart_td_price_f { + text-align: right; + white-space: nowrap; +} +.mod_bakery_cart_td_shipping_f { + text-align: right; + white-space: nowrap; +} +.mod_bakery_cart_td_sum_f { + text-align: right; + white-space: nowrap; +} + +/* CART table details */ +.mod_bakery_cart_currency_f { + font-size: 9px; + font-weight: normal; +} +.mod_bakery_cart_item_f { + font-weight: bold; +} +.mod_bakery_cart_item_desc_f { + font-size: 10px; +} +.mod_bakery_cart_subtotal_f { + text-align: right; + font-weight: bold; + line-height: 200%; +} +.mod_bakery_cart_shipping_f { + text-align: right; + font-weight: bold; + line-height: 75%; +} +.mod_bakery_cart_free_shipping_f { + text-align: right; + font-weight: bold; + line-height: 75%; + color: #FF0000; +} +.mod_bakery_cart_tax_f { + text-align: right; + font-weight: bold; + line-height: 75%; +} +.mod_bakery_cart_total_f { + text-align: right; + font-weight: bold; + line-height: 300%; +} + + +/* MINI CART */ + +#mod_bakery_mc_div_f { + width: 250px; + float: right; + font-size: 11px; +} +.mod_bakery_mc_h2_cart_f { + +} +.mod_bakery_mc_p_empty_f { + font-weight: bold; +} +.mod_bakery_mc_p_orderid_f { + +} +.mod_bakery_mc_orderid_f { + font-style: italic; +} +.mod_bakery_mc_p_summary_f { + +} +.mod_bakery_mc_quantity_f { + font-weight: bold; +} +.mod_bakery_mc_total_f { + font-weight: bold; +} +.mod_bakery_mc_p_excl_f { + font-size: 10px; +} + + +/* ADDRESS FORM & ADDRESS */ + +.mod_bakery_form_p_f { + font-style: italic; +} +.mod_bakery_form_label_f { + width: 25%; + text-align: right; + font-weight: bold; + white-space: nowrap; +} +.mod_bakery_form_input_f { + width: 280px; +} +.mod_bakery_address_h_f { + font-weight: bold; +} +.mod_bakery_address_p_f { + +} +.mod_bakery_tax_no_h_f { + font-weight: bold; +} +.mod_bakery_tax_no_p_f { + +} + + +/* PAY */ + +.mod_bakery_pay_h_f { + padding-left: 12px; +} +.mod_bakery_pay_h_f img { + padding-left: 8px; +} +.mod_bakery_agree_tac_f { + height: 40px; + vertical-align: middle; + padding-left: 12px; + background-color: #ECECEC; + border-color: #CBCBCB; + border-width: 1px; + border-style: solid; +} +.mod_bakery_err_agree_tac_f { + border: solid 1px red; + background-color: #FFDCD9; +} +.mod_bakery_cust_msg_f { + font-weight: bold; +} +.mod_bakery_cust_msg_ta_f { + width: 98%; + height: 80px; +} +.mod_bakery_pay_method_f { + font-weight: bold; +} +.mod_bakery_pay_td_f { + font-size: 11px; + padding: 3px 12px; +} +.mod_bakery_pay_submit_f { + height: 30px; + text-align: center; +} +.mod_bakery_selected_pay_h_f { + padding-left: 20px; + font-weight: bold; +} + + +/* BUTTONS */ + +.mod_bakery_bt_cart_f { + +} +.mod_bakery_bt_add_f { + +} +.mod_bakery_bt_continue_f { + +} +.mod_bakery_bt_update_f { + +} +.mod_bakery_bt_add_ship_form_f { + +} +.mod_bakery_bt_order_f { + +} +.mod_bakery_bt_cancel_f { + +} +.mod_bakery_bt_modify_address_f { + +} +.mod_bakery_bt_modify_pay_methods_f { + margin-left: 40px; +} +.mod_bakery_bt_buy_f { + width: 45%; +} +.mod_bakery_bt_pay_cod_f { + width: 98%; +} +.mod_bakery_bt_pay_advance_f { + width: 98%; +} +.mod_bakery_bt_pay_invoice_f { + width: 98%; +} +.mod_bakery_bt_pay_paypal_f { + width: 98%; +} +.mod_bakery_bt_pay_payment-network_f { + width: 98%; +} + + +/* MESSAGES */ + +.mod_bakery_error_f { + text-align: center; + color: red; + margin-top: 5px; + border: solid 1px red; + background-color: #FFDCD9; + background-image: url(images/error.gif); + background-position: 15px center; + background-repeat: no-repeat; +} +.mod_bakery_error_f p { + padding-left: 60px; + padding-right: 6px; +} +.mod_bakery_errorbg_f { + background-color: #FFDCD9; +} +.mod_bakery_success_f { + text-align: left; + color: green; + margin-top: 5px; + border: solid 1px green; + background-color: #D4FFD1; + background-image: url(images/success.gif); + background-position: 15px center; + background-repeat: no-repeat; +} +.mod_bakery_success_f p { + padding-left: 60px; + padding-right: 6px; +} +.mod_bakery_information_f { + text-align: left; + margin-top: 5px; + border: solid 1px #FFD700; + background-color: #FFFFDD; + background-image: url(images/information.gif); + background-position: 15px center; + background-repeat: no-repeat; +} +.mod_bakery_information_f p { + padding-left: 60px; + padding-right: 6px; +} + + +/* IE ONLY */ + +/* IE < 7 */ +* html input.mod_bakery_bt_continue_f, * html input.mod_bakery_bt_update_f, * html input.mod_bakery_bt_order_f, * html input.mod_bakery_bt_cancel_f { + font-size: 9px; +} +/* IE = 7 */ +*:first-child+html .mod_bakery_bt_continue_f, *:first-child+html .mod_bakery_bt_update_f, *:first-child+html .mod_bakery_bt_order_f, *:first-child+html .mod_bakery_bt_cancel_f { + font-size: 9px; +} + + +/* LIGHTBOX2 (compressed) */ + +#lightboxOverlay{position:absolute;top:0;left:0;z-index:9999;background-color:black;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=85);opacity:0.85;display:none;} +#lightbox{position:absolute;left:0;width:100%;z-index:10000;text-align:center;line-height:0;font-family:"lucida grande",tahoma,verdana,arial,sans-serif;font-weight:normal;} +#lightbox img{width:auto;height:auto;} +#lightbox a img{border:none;} +.lb-outerContainer{position:relative;background-color:white;*zoom:1;width:250px;height:250px;margin:0 auto;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;} +.lb-outerContainer:after{content:"";display:table;clear:both;} +.lb-container{padding:10px;} +.lb-loader{position:absolute;top:40%;left:0%;height:25%;width:100%;text-align:center;line-height:0;} +.lb-nav{position:absolute;top:0;left:0;height:100%;width:100%;z-index:10;} +.lb-container > .nav{left:0;} +.lb-nav a{outline:none;} +.lb-prev,.lb-next{width:49%;height:100%;background-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");/* Trick IE into showing hover */display:block;} +.lb-prev{left:0;float:left;} +.lb-next{right:0;float:right;} +.lb-prev:hover{background:url(lightbox2/images/prev.png) left 48% no-repeat;} +.lb-next:hover{background:url(lightbox2/images/next.png) right 48% no-repeat;} +.lb-dataContainer{margin:0 auto;padding-top:5px;*zoom:1;width:100%;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-ms-border-bottom-left-radius:4px;-o-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-ms-border-bottom-right-radius:4px;-o-border-bottom-right-radius:4px;border-bottom-right-radius:4px;} +.lb-dataContainer:after{content:"";display:table;clear:both;} +.lb-data{padding:0 10px;color:#bbbbbb;} +.lb-data .lb-details{width:85%;float:left;text-align:left;line-height:1.1em;} +.lb-data .lb-caption{font-size:13px;font-weight:bold;line-height:1em;} +.lb-data .lb-number{display:block;clear:left;padding-bottom:1em;font-size:11px;} +.lb-data .lb-close{width:35px;float:right;padding-bottom:0.7em;outline:none;} +.lb-data .lb-close:hover{cursor:pointer;} diff --git a/frontend.js b/frontend.js new file mode 100644 index 0000000..7e0f9f6 --- /dev/null +++ b/frontend.js @@ -0,0 +1,81 @@ +/* + Javascript routines for WebsiteBaker module Bakery + Copyright (C) 2007 - 2015, Christoph Marti + + This Javascript routines are free software. You can redistribute it and/or modify it + under the terms of the GNU General Public License - version 2 or later, + as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html. + + The Javascript routines are distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +*/ + + + +// ********************************************************************************** +// Function to delete an item in the cart +// ********************************************************************************** + +function mod_bakery_delete_item_f(id) { + if (id != '') { + document.getElementById('id_' + id).value = 0; + document.getElementById('update').click(); + } +} + + + +// ********************************************************************************** +// Function to toggle between state text field and drop down menu +// ********************************************************************************** + +function mod_bakery_toggle_state_f(shopCountry, type, clean) { + if (shopCountry != '') { + var country = document.getElementsByName(type + '_country')[0].value; + if (country == shopCountry) { + document.getElementById(type + '_state_text').style.display = 'none'; + document.getElementById(type + '_state_select').style.display = 'table-row'; + document.getElementsByName(type + '_state')[1].value = document.getElementsByName(type + '_state')[0].value; + } else { + document.getElementById(type + '_state_select').style.display = 'none'; + document.getElementById(type + '_state_text').style.display = 'table-row'; + if (clean == 1) { + document.getElementsByName(type + '_state')[1].value = ''; + document.getElementsByName(type + '_state')[1].focus(); + } + } + } +} + + + +// ********************************************************************************** +// Functions to take over the state select value to the state text field +// ********************************************************************************** + +function mod_bakery_synchro_cust_state_f() { + document.getElementsByName('cust_state')[1].value = document.getElementsByName('cust_state')[0].value; +} + +function mod_bakery_synchro_ship_state_f() { + document.getElementsByName('ship_state')[1].value = document.getElementsByName('ship_state')[0].value; +} + + + +// ********************************************************************************** +// Function to check if customer has agreed to the terms & conditions of the shop +// ********************************************************************************** + +function checkTaC() { + if (document.getElementById('agree').checked != true) { + alert(document.getElementById('txt_js_agree').firstChild.nodeValue); + document.getElementById('agree_tac').className += ' mod_bakery_err_agree_tac_f'; + document.getElementById('agree').focus(); + return false; + } else { + return true; + } +} \ No newline at end of file diff --git a/help.php b/help.php new file mode 100644 index 0000000..e131f7b --- /dev/null +++ b/help.php @@ -0,0 +1,938 @@ +query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_general_settings"); +if ($query_general_settings->numRows() > 0) { + $general_settings = $query_general_settings->fetchRow(); + $general_settings = array_map('stripslashes', $general_settings); +} + +// Get page settings +$query_page_settings = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_page_settings WHERE page_id = '$page_id'"); +if ($query_page_settings->numRows() > 0) { + $page_settings = $query_page_settings->fetchRow(); + $page_settings = array_map('stripslashes', $page_settings); +} + +// Get continue url +$query_continue_url = $database->query("SELECT p.link FROM ".TABLE_PREFIX."pages p INNER JOIN ".TABLE_PREFIX."mod_bakery_page_settings ps ON p.page_id = ps.page_id WHERE p.page_id = ps.continue_url AND ps.section_id = '$section_id'"); +if ($query_continue_url->numRows() > 0) { + $fetch_continue_url = $query_continue_url->fetchRow(); + $continue_url = stripslashes($fetch_continue_url['link']); +} + +// Get customer data +$query_customer = $database->query("SELECT invoice_id, invoice FROM ".TABLE_PREFIX."mod_bakery_customer WHERE submitted != 'no' ORDER BY order_id DESC LIMIT 1"); +if ($query_customer->numRows() > 0) { + $customer = $query_customer->fetchRow(); + if ($customer['invoice'] != '') { + // Convert string to array + $invoice = stripslashes($customer['invoice']); + $invoice_array = explode("&&&&&", $invoice); + // Vars + $order_id = $invoice_array[0]; + #$shop_name = $invoice_array[1]; + #$bank_account = $invoice_array[2]; + $cust_name = $invoice_array[3]; + $address = $invoice_array[4]; + $cust_address = $invoice_array[5]; + $ship_address = $invoice_array[6]; + $cust_email = $invoice_array[7]; + $html_item_list = $invoice_array[8]; + $order_date = $invoice_array[9]; + $cust_tax_no = $invoice_array[15]; + $cust_msg = $invoice_array[16]; + + // Invoice id + $invoice_id = $customer['invoice_id']; + + // For invoice template chop phone number and email from customer address + $arr_invoice_tpl_address = explode("

", $invoice_array[4]); + $invoice_tpl_address = $arr_invoice_tpl_address[0]; + $arr_invoice_tpl_cust_address = explode("

", $invoice_array[5]); + $invoice_tpl_cust_address = $arr_invoice_tpl_cust_address[0]; + } +} + +// Get items +$query_item = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_items ORDER BY item_id DESC LIMIT 1"); +if ($query_item->numRows() > 0) { + $item = $query_item->fetchRow(); + $item = array_map('stripslashes', $item); +} + +// Get page info +$query_page = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'"); +if ($query_page->numRows() > 0) { + $page = $query_page->fetchRow(); +} + +// Check if we should show number of items or "in stock" message or nothing at all +// Display number of items +if ($general_settings['stock_mode'] == "number") { + if ($item['stock'] < 1) { + $stock = 0; + } else { + $stock = $item['stock']; + } +// Display text message +} elseif (is_numeric($general_settings['stock_limit']) && $general_settings['stock_limit'] != '') { + if ($item['stock'] < 1) { + $stock = $MOD_BAKERY['TXT_OUT_OF_STOCK']; + } elseif ($item['stock'] > $general_settings['stock_limit']) { + $stock = $MOD_BAKERY['TXT_IN_STOCK']; + } else { + $stock = $MOD_BAKERY['TXT_SHORT_OF_STOCK']; + } +// Display nothing +} else { + $stock = ''; +} +?> + + + +

KEYS TO THE PLACEHOLDERS USED IN THE BAKERY TEMPLATES

+
+ + + + + +
Template
+
    +
  • PH = Page Header
  • +
  • PPL = Page Product Loop
  • +
  • PF = Page Footer
  • +
  • IH = Item Header
  • +
  • IF = Item Footer
  • +
+
Output Example Data
+
    +
  • Blue: Localisation (example language = )
  • +
  • Green: General settings
  • +
  • Brown: Page settings (example page id = )
  • +
  • Red: Order and Customer (example order id = )
  • +
  • Orange: Item (example item id = )
  • +
  • Pink: Page (example page id = )
  • +
+
+
+ + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Main Page and Item HTML Templates    ( > Page Settings > Layout Settings )

PlaceholderPH PPLPFIHIFExplanationOutput Example Data
[ADD_TO_CART] PPL IHIFLocalisation of "Add to cart"
[BACK]   IHIFURL to the current (overview) page".PAGES_DIRECTORY.$page['link'].PAGE_EXTENSION : " "); ?>
[CURRENCY] PPL IHIFCurrency (general setting)
[DATE] PPL IHIFItem modification date
[DESCRIPTION] PPL IHIFItem description
[DISPLAY_NAME] PPL IHIFUser display name
[DISPLAY_PREVIOUS_NEXT_LINKS]PH PF  CSS display: none
[EMAIL] PPL IHIFUser email
[FIELD_1]
[FIELD_2]
[FIELD_3]
 PPL IHIFUp to 3 free definable item fields which can be defined in the general settings.
[FULL_DESC] PPL IHIFItem full description
[IMAGE] PPL IHIFMain item image - only displayed if selected at section "2. Product Images" of the "Add/modify item" pageDepends on various settings: For an example please see the source code of your Bakery page!
[IMAGES] PPL IHIFAll item images except for the item main image Depends on various settings: For an example please see the source code of your Bakery page!
[ITEM_ID] PPL IHIFItem id
[LINK] PPL   Link to the item (detail)".$item['link'].PAGE_EXTENSION : " "); ?>
[NEXT]   IHIFLink to the next item >>
[NEXT_LINK]PH PF  Link to the next page >>
[NEXT_PAGE_LINK]PH PF  Link to the next page >>
[OF]PH PFIHIFView number of items out of total number of items 1-3 10
[OPTION] PPL IHIFItem optionSize:
+ <select name='attribute1' class='mod_bakery_main_select_f'>
<option value='XL'>XL</option>
<option value='X'>X</option>
<option value='M'>M</option>
<option value='S'>S</option>
<option value='XS'>XS</option>
</select>
[OUT_OF]PH PFIHIFView item number out of total number of items2 10
[PAGE_TITLE]PHPPLPFIHIFPage title
[PREVIOUS]   IHIFLink to the previous item<<
[PREVIOUS_LINK]PH PF  Link to the previous page<<
[PREVIOUS_PAGE_LINK]PH PF  Link to the previous page<<
[PRICE] PPL IHIFItem Price
[SHIPPING] PPL IHIFItem Shipping
[SHIPPING_DOMESTIC] PPL IHIFShipping domestic
[SHIPPING_ABROAD] PPL IHIFShipping abroad
[SHIPPING_D_A] PPL IHIFShipping domestic/abroad
[SHOP_URL]PHPPL IHIFContinue shopping URL (page setting) = URL to the current (overview) page".$continue_url.PAGE_EXTENSION : " "); ?>
[SKU] PPL IHIFStockkeeping unit, item no or product code
[STOCK] PPL IHIFDepending on the general setting "Stock mode" either the number of items in stock, an image or a localised short message like "in stock", "short of stock" or "out of stock".
[TAX_RATE] PPL IHIFItem Tax Rate
[TEXT_OF]   IHIFLocalisation of "of"
[TEXT_OUT_OF]   IHIFLocalisation of "out of"
[TEXT_READ_MORE] PPL   Localisation of "Read more"
[TXT_ABROAD]   IHIFLocalisation of "Abroad"
[TXT_BACK]   IHIFLocalisation of "Back"
[TXT_DOMESTIC]   IHIFLocalisation of "Domestic"
[TXT_FIELD_1]
[TXT_FIELD_2]
[TXT_FIELD_3]
 PPL IHIFLabels for up to 3 free definable item fields which can be defined in the general settings.
[TXT_FULL_DESC]   IHIFLocalisation of "Full description"
[TXT_ITEM]PHPPLPFIHIFLocalisation of "Item"
[TXT_PRICE] PPL IHIFLocalisation of "Price"
[TXT_SHIPPING]   IHIFLocalisation of "Shipping"
[TXT_SHIPPING_COST]   IHIFLocalisation of "Shipping cost "
[TXT_SKU]   IHIFLocalisation of "SKU"
[TXT_STOCK] PPL IHIFLocalisation of "Stock"
[TXT_TAX_RATE] PPL IHIFLocalisation of "Tax Rate"
[THUMB] PPL IHIFThumbnail of the main item image - only displayed if selected at section "2. Product Images" of the "Add/modify item" pageDepends on various settings: For an example please see the source code of your Bakery page!
[THUMBS] PPL IHIFAll thumbnails of the item images except for the item main image Depends on various settings: For an example please see the source code of your Bakery page!
[TIME] PPL IHIFItem modification time
[TITLE] PPL IHIFItem title / Item name
[USERNAME] PPL IHIFUser name
[USER_ID] PPL IHIFUser id
[VIEW_CART]PH    Localisation of "View cart "
+

Email Templates    ( > Payment Methods > E-Mail Settings )

PlaceholderExplanationOutput Example Data
[ADDRESS]Either the value of [CUST_ADDRESS] or - if provided by the customer - the value of [SHIPPING_ADDRESS]
[BANK_ACCOUNT]Information about the shop bank account (general setting)
[CUST_ADDRESS]Customer address
+ Contains the data of the first part of the Bakery address form: The customer postal address, phone number and email.
+ It is the main address and used for billing and - if no shipping address is provided by the customer - for shipping as well.
[CUST_EMAIL]Customer email address
[CUST_MSG]Customers message: Notice written by the customer is sent to the shop admin by email
[CUST_TAX_NO]Customer VAT-No
[CUSTOMER_NAME]Customer first and last name
[ITEM_LIST]List of all ordered items 
[ORDER_ID]Order id
[SHIPPING_ADDRESS]Shipping address
+ If the shipping address differs from the customer address and it is provided by the customer, it contains the data of the second part of the Bakery address form: The shipping postal address.
+ It is used for shipping only.
[SHOP_NAME]Shop name (general setting)
+

Invoice Template    ( > Payment Methods > select Invoice > Layout Settings )

PlaceholderExplanationOutput Example Data
[ADDRESS]Either the value of [CUST_ADDRESS] or - if provided by the customer - the value of [SHIPPING_ADDRESS]
[BANK_ACCOUNT]Information about the shop bank account (general setting)
[CURRENT_DATE]Current date when you load the invoice from the server
[CUST_ADDRESS]Customer address
+Contains the customer postal address of the first part of the Bakery address form. It is the main address and used for billing and - if no shipping address is provided by the customer - for shipping as well.
[CUST_EMAIL]Customer email address
[CUST_TAX_NO]Customer VAT-No
[CUSTOMER_NAME]Customer first and last name
[DISPLAY_DELIVERY_NOTE]Displays the contained html text at delivery note pages only. Use like this:
+ <div style="display: [DISPLAY_DELIVERY_NOTE]">Your specific delivery text.</div>
Delivery note: "" (empty)
+ Invoice and reminder: "none"
[DISPLAY_INVOICE]Displays the contained html text at invoice pages only. Use like this:
+ <div style="display: [DISPLAY_INVOICE]">Your specific invoice text.</div>
Invoice: "" (empty)
+ Delivery note and reminder: "none"
[DISPLAY_REMINDER]Displays the contained html text at reminder pages only. Use like this:
+ <div style="display: [DISPLAY_REMINDER]">Your specific reminder text.</div>
Reminder: "" (empty)
+Invoice and delivery note: "none"
[INVOICE_ID]Consecutive numbering of invoices.
Please note: Invoice id usually is not equal order id.
[ITEM_LIST]List of all ordered itemsFor an example see the commented lines in the source code of this page! + + +
[ORDER_DATE]Date and time when customer made his order
[ORDER_ID]Order id
[SHIPPING_ADDRESS]Shipping address
+If the shipping address differs from the customer address and it is provided by the customer, it contains the data of the second part of the Bakery address form: The shipping postal address.
+It is used for shipping only.
[SHOP_NAME]Shop name (general setting)
[TITLE]Displays the localisation of "invoice", "delivery note" or "reminder" depending on the admins selection

[WB_URL]WebsiteBaker URL (used for invoice logo)

PLEASE NOTE:
+ Don't forget to add your companys name and address to the invoice template and replace the Bakery logo by your shop logo.

+
+ + +print_footer(); diff --git a/images/ajax-loader.gif b/images/ajax-loader.gif new file mode 100755 index 0000000000000000000000000000000000000000..bcc73797bd35c00eafc5c424c10d461e439447d2 GIT binary patch literal 1456 zcmb`GX;2eq7=XVDh+9wymY7g0#BQt+N@5Tj6}btAoJOt4p%GEQ1FMWj?KrYWP6Ai~ zg>uSe!YM}pQ7{m>K|{C(1mqIL>a^2oXZok@F8$MK>7P#b=g!VP-}8L$>+Q?u?Gc&- zbMOlQZ{GjR%i6o}{g2t*MHwAAlS@l&6MX|SW5oj%#QUtS0?l|&s50_m-Ia;O#j+Q5 zxjiM*Z{B{Z&Gah_tQ~r+d|p%7ru%Th( zY2#?y^`@Iw8^5{Hl$iD`TR%6I(w?#S?xzO>4}A&_9C;9Wx&GSTET{O|gpSGQk>ybd z>g&Gu1E!aj`(BL}^_LINO^+_jMpedC=+q&_f`G!{YJHQaB`L1vVwmbg;$w05)X7`r+1_&DgDG(TmxMlKv{sJbqBo zLGXV+jNeTHy$%UH+=9Kh_8fx`i2pNwv+}qUElh|$Wpgz)A;v}+C%kqpUU zqmwW^rDIC;y2RDsXGys6F2^rWsmuX_*n9Twr|&^+*;bp_3ZD5sXdef)gVuBHEp{6* z6p$nOIcukp)Y8e>iHq8EYGoW38(CXBV8U7iW+EM3pl3igh|;vf1btLWqf=zl-JQsc zmf5TCT9v;dPiUYLDKLN_OTe_)A*CRO3aYCcw9N~p&}l19JZA-8a$mZ|-D8)xjF9)N zt0R-8!cBmo*xsr!Rj@QD5$R5EQ-w^A
db;E#fS-=^GFx=3%by|TFo#xfBTqnQ9gNyZB$(NjSk3(dY^+UHqLqHxD7INK)m0Mkx^+
zDyjJ^CGv@h!*fvEBS()sM((7O6%IQq`B)}Hx!wEAQ1>vgsgeb}k6FvfnOPnF5Anal
z#mv-PSO)Ir73a&T!DgZen+TM@5n|9WPl25k8V+e#WDla!36$;uIdL5{Z0pG5CRjiS
z7qB(FGIC)48=DZ4K!f;ZRNxPNQcb^i$4T
zxgr|QaoL%Ik(Sk%Lk?RFC$n>S&B>&g8mDmAbfQdm+Xxj-tVb1AP>2YQ3p_LKA>%2E
NzSoIhAGzNv&mUFZ{@MTl

literal 0
HcmV?d00001

diff --git a/images/amex.gif b/images/amex.gif
new file mode 100644
index 0000000000000000000000000000000000000000..fd45ef04261ca4d4dfe75d30a407607e1f2a0112
GIT binary patch
literal 645
zcmV;00($*NNk%w1VI=?+0M!5h)#&s9XSD!nwMD4ccg5?7yxl~Y%xJsh0CKrksMNOA
z>Wj$d09&m9iN+>|!u9(8H>K8Hw&NCiyL-3W0+h{es@4Ag|2B=r>-PI&wci9@ovEBX{Xc=c)Dw_*Cc(v4sNwJp49a8^!E4oVVud{>hdU{)8X&;0DizkjlrS8
z-v9sqA^8LW002J#EC2ui03`qw000L6z~ApcD7ucV;vw=GKy(yJqrs~pt{#Clz!eIK
z#-wuDgsh@dD>l3BdNbhSnCv`DscLq+5D-n1P6n#092c4w20ffC54EAOG!n2mk~E&u>is
z$dF;6ih;$DRV+4E0S4vDm|?gI@C!#DEmsoh!KA4)gVU(Fp#B`XwW86aGi_+g#|!8+
fxM9auy#d3F+CpyY9-gUqan{7!C^ybrNDu%!L`@`-

literal 0
HcmV?d00001

diff --git a/images/box_bg.png b/images/box_bg.png
new file mode 100755
index 0000000000000000000000000000000000000000..f8edc5a91714690104596c450b161690eee136da
GIT binary patch
literal 943
zcmV;g15o^lP)+kkw
zaffPjiD7JlaC(mH@b*+-d2V=(UuuDEcZ})p^<-{^b$^mxX@Fa1et3bEdV`i+Xn$*V
zi*tOCcYu_AhM94Dk7#plh`S|(z>hJdO^Y`=h`04KT%y7#j0007VNkl=DcS>Qc-z$+@?b6w3
zjWLw9%&BVCi|ml-gZG@$y>RXmfXOjN0RV)7m<1OH-%-%j|G&*UB3Q`SUedGsfI=dHRBFXJYQ6%HLB=W&!cY+0MlCGV
z&f3aCJ-9;&DB}NrmE%4R5vQ0YkYrX9s0MYQ0n~$9&?D{%f{aW&`>8x7g
zKUfn8I|$`?8}&*;_0CVVmXmELTN7(TxT{xyR_Y`LVJHfsXn_r)j%>kR5W$(K13Ps8
zyAq4b`-I3Rif43ZN>VT0mA5s9_RtPmLJMdB&7dCChbGVv+CXz?1+Aejw1uY`8+DxF
zN9D&=hu@sv-Vq*%M{m>DigRe)`7KGiT21J9lr#$=inyAKtTP&)R+Gw{G1!edDRM
zYu8R$cf5b);iXHL_AJ}qwfsoKg8egR&a9ogw{*(pq|WtetxG~1RtA*M^{!arTQb`v
zd!ljLOr7{i2C-dQF}{hu9#%cfm
z|1V5h^bqJg!;&DsU?7(yz#u=%PZ6k@v%n*=n1O*?2!t6g-L3lr6qGM(Z2uxGA{=^
zduR9g*+u)+zdwJc!8v0=>~;Rb7s{^V*gyH(D7cwe*$$jCng>
zvahOho;>49$fUKi`gTfs32FpeO;5^J(^2FsndZ7se#W$!Qu}w_Oa47WtuSQHXEy6O
zGkZd{W;*me?>5|i)bVO$X6T94(|sg;4Fq?Zw^;gQCYI-!r!U!XW=q>=i?aL#af$ou
ze2;zkA3RUO&OGGVw~l4m*ZP^=Pc7u;>E5&G%(x6W&Sh){uRJI~eUS$^!!(iI+)6BI(jW~7Mp
z{Zu|_7(8Y9(-V_cicW|;@GK(7HP`CmYe3Jmo*6Sy$|e@Y;JzPd~OOm+a_P3
zBRLjVa$nELIP`eE#_^tmi}zbRG@Q-&t*GeEVx?ua)&aM^t-HWd+*M`pOp)z!=*8ff
z6$hO)XU)p3So+}Kt$Syu-`6;P4#3l0QjSZtMB{Boc2rCHmaU6%Or_v=?%9e{`Av7-|qA&S|uIcpO+T@$n~@Q9-nu-qO!8b
Qfysu!)78&qol`;+07SRD<^TWy

literal 0
HcmV?d00001

diff --git a/images/checkout_steps/step_2.png b/images/checkout_steps/step_2.png
new file mode 100644
index 0000000000000000000000000000000000000000..b489c1881cd0604b34aef70e0bcef480ddc600e8
GIT binary patch
literal 982
zcmeAS@N?(olHy`uVBq!ia0vp^!9Xm@!3-p;)<3cUQq09po*^6@9Je3(KLBz!2Ka=y
ze*OCO)7KyG-o1PF=F_uh&u%Of9m-Z~%-?jY6%$YNr=WMH)v!{58%#*rx;wKr!v>L>AX~y)cM)s(Ow<`wq
zCyjY9U?7)Fz_9R$
zwH(kG&H|6fVg?3oArNM~bhqvgP*A?aHKHUqKdq!Zu_%?nH!-;=KQ}ccGf}}UvnaJZ
zzbLy{!D4I1r3#=@agb8yqSVBa%=|oskj&gv26H__Lp>t{L!(1F@3$~8FsXaGIEHw1
zwobhrcH2O}Rdn(RKhY)u4L|QoVwWXcqJ^X~r2qbJ550czL|EAQZrkjdZD}RO7agY*
zYO1D(h?i`AIVI@svsF`MEIaE>oZLFoGNQg}t%~QJ%(^@|EGFqA*X*>phhC*wM3zLQ
zsix>PF4!FR^p)V2H!7_xZG96Ys*YvOSo!DWl%r~kbWQHn$DElSpY+@CH1@{9AghHg!+CJ~A+y0BkM||JLicwRQ#Z?pD%AH&fOjQh?u6{1-oD!MAD%sXcH`med-v{Lz4!duwQHxZKRI#r;h8gM_MN+T`0(Kk
zN3QSLvuD-b3oCY?+q!k@(yiwfZaF@G>zU~rPpw_McG`wh6IUNux^!v(%EMjDk8~~B
zH*@C9<~iGH=Ip7OxwCl6mekHQ$!#l>nij@1EDmj0=~uDHqim6T!7PWoS&rFLt#jrW
zr_D4^>eh*$WE9h?71gC0*`prbt{BuKAKWJAUoYd|B<)ip=2|M`R>|*N#^F@VXF$a#`pC^9d_2IuecQ0AVu-r*&?bb=GdloFQT=U%b@|o9)cLjcghRq6@
z`rFgoZ5O^WL-AJzAvF
zUg(}zE%nIkdN$+v&xHFWz3b2Y{%iQ~x$fpK9>)JC#om6}>7||Yx#cVOTxoV&L!bL|
zSdOhRI6HIa&(A%fz00)M=C@s7tnk0vyx{+_uRN~eYc@<NfYQNDlYCSiR-8yVWA^9I{WB7oXXPF5@0-;cA8@38
z#*B1P<+VG1oGjt_a4}Y|WlqIbANdEnb{|-?AmCwp#<^=@)8AVifBjYRfaI~)Gd2Dl
zJn~mkCQvG{CrrJ3_*
zBa`mCfi?=udd|GOmX*2i@!HE1
zjjH?ifBSl)`1zkF!D~3}p9iPqf3}_`tGBPeWXjUV-vdv*x%>CwuFZ=@P5uP5x7ezl
z?N0Zv*>@niX;0CGYm3?0^>2rtUA+4D-MsSpQWx`oOj+%|iz1$jb%0W)r>mdKI;Vst
E0DyH6WdHyG

literal 0
HcmV?d00001

diff --git a/images/dd_grip.png b/images/dd_grip.png
new file mode 100644
index 0000000000000000000000000000000000000000..fb523d9a1423dd3f7e2007398188fcce468da7a3
GIT binary patch
literal 38596
zcmbq)Ra6~K)Fp&q!E$kTcXxMpcXxLu0fM``1Pgj`cbDMq?hY5fz~q~M=3$eD+?Sy2k<8}2s<2nZw@X>rwmJ^DZ6f`j>oh;_E9|GKYkqB81m|C&FX
zdBndlytA~98w3Ob>VF0~w;2fjcM;27Lfc);)xyNx#>tUb-NwNJf}4?rg^`t+g_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%I@iO0VAk
zt|6at7Gd$GC%vDoBJEvbZB}b`A}^V6*Ea4H#J;@)hv4hJDSX*zu#Q$|$Ch
zJhyjDk5=#^`KTN-kFx4XzH{|c@{;q#5%Oi(82Z-26f_i0yT91p
zg76j3M;&30%hxwTk^bH^OPil}B6fZqAl?77zq=L2Z)5TI-G9bCilr{GMuu&rcg>4!
zAFcIgzcFT5!lYhiedp<;rdY1FV)C<-a_s%I3<@TW9wxG
z#+S7(yQ(@KBqv>6yY_!tTAzsAgA?bz)VBWr|9^Kv#tud4
z3)4D2fB3L(`plnQ%@29GjufA?Ec+qUfzxV5#MVkJzuu*
zPl*3g9?|RDwmz$Cd2sd8gTTnUd4*3I7*1^3u}@U+^OJ}FlL}u~wq0K^ZDnikE+MVQ
z){fgn1pk+`?V7oKpKt6L28Qq7zkR)X?;az=P6oE`@83UNv-!sQP3P4V5A;l)!o>dc
z>Xid6owv`Pxj%E}QV!0q&tCq|D0*Mr!$1R|_>+Z^ok5d92V^!VP8itdHE1?9x3o43
z$2zn%sk<~KDwyh+w+e@c`!|_s=ez_@

literal 0
HcmV?d00001

diff --git a/images/discover.gif b/images/discover.gif
new file mode 100644
index 0000000000000000000000000000000000000000..29ad882356adbb73b9560c9ba04dc15cb53bc4ea
GIT binary patch
literal 495
zcmVPx^0tNdzmxjdzW@9A_xJb4#l`!}sN&+{z`wutk3#a{)AfltH#If$^YiWP
z?f?J(A^8LW002J#EC2ui03`qw000L6z~3)GEE#PR9cZ6nG*}&4JegHz$YBS_T9Q1O`0@3+4a|TI5s&2L}@iH7Xdw3?C^~
z6y#B1H-Uza2=5}?n81Nbh!FzMR3WiJfPjb+qlBnv@glB_Q5qx|(Xk^&GZie9TzPU!
lg$_AZ%4{h`q)M4MJ$}(b!bXP-oIovlQbM%ok{>|;06W>9?qC1_

literal 0
HcmV?d00001

diff --git a/images/email.png b/images/email.png
new file mode 100644
index 0000000000000000000000000000000000000000..244f04ae15277e4b20ca9c99f627beadecf23c18
GIT binary patch
literal 756
zcmVYCj9)0M$R^4v<1rbljMjA>+a4*Fv?vRhe{~gr
z%Dh6QGei@IC{91XUoMy!8piefTprt(G*USyp&U=#>zgJyrzjLP6B&-PJrzNYsRhW}abY-=o|braxZC!={j}CE5Rpfy5PR8yX4z5xy*}
ztSSisPRYSHeV<*&Z}a8BIY#Ms7s7Cbbv+>flXm`dkZsR)Ahv@B#N$BW8|H*E=uaL^Dpo+dHYMiN4-
zIrR{~4g*QN((=Y<@+z19F(uVfdg9>O-pYU#3dw*eq%<*1foXtY2n@N(Thl^-b{(Zw
m7UwhR(d2ir-fuKmCw>B@7##EPk)wG40000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2j2q(
z5;X-Xhp74h00FK^L_t(I%cYaQYg17ehM#lpxm<11#DcB$8U^nl4rWLkT7rh+WNV927%9OH15}OKt0qAhx2`-t^|?-1|ACjaINm^TOHA`|!Ts
z`Hm71hLQP~%PVtdiNjMk*&^Y_b5!&JHE4qOwE*K?;o#x(J2>cyLv$e1JSLtxOmq017UCYwyB9-FA9!R~}qEeh-X>}3XwR@(l
z+nodf;@DDKXfRuu!MLUm*)<#2Fk6|Sw$Q+KEh2y@bh~3ENrlJr4K7We`}w}Ep<4E-
zmVJ!dTUev%LvkY?NGg=BK6n#bk^eatZarEy@z(m<)Q!0@Z#0uJo}-L$(2l~KCdsod#i^1jhZ3#11(+ZP7s6T6aWAK07*qoM6N<$f+gYnqW}N^

literal 0
HcmV?d00001

diff --git a/images/email1.png b/images/email1.png
new file mode 100755
index 0000000000000000000000000000000000000000..8a1ff5e231ca1418f6f5ee58c9e9edb937acc14a
GIT binary patch
literal 556
zcmV+{0@MA8P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2j2q(
z5<4GBW_%6+00FE?L_t(I%e9ifYg17ehM#lpZLT!5MTr504t9ybf_Q2R#h+cS4m3O2?hg66gzYlW7luNquFcf9AX$LE|b
zxR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6;haN&dqsj4~w1iDVZst8VS0je!_0s)2(
z8tmG@0?anRs|G%R0R*Fy03ZMX1{jdQ3Q~~a#0?@;&_D$u+~5QmQml|bwgdU5tUo8fc8s1rj*aJMX&f3K9qaJAa)EP5=M^

literal 0
HcmV?d00001

diff --git a/images/in_stock.gif b/images/in_stock.gif
new file mode 100644
index 0000000000000000000000000000000000000000..66a64311565890e0255ba2bdd2d7bccb1af4739f
GIT binary patch
literal 1125
zcmZ?wbhEHb)MVgg_|5uLd4)cww=`=8bbzN+niN;CMPcF1|%kn?(x7fiA~Iz*o{&wlTe``#sdzgg}Z
z*YJJjd2ikFUc2YN@yL7S5r4`q_LyzKYp?v5UU5h53to5^zVa!0)B;WOXj
z7k1U6+-+gaw=2VfOJx3*$hMm~#p13DC9Nk5y3dz&oG6)av8L}_b^p2QuH)sCF4pxQubXkP
zZN`Q6nHM_dUhJKJsei`F&Y35>W}WPwe}2M(^ONSD>R)tW%Bm}KS6`mL;rf#GmzHk3
zv1a>?wRvw{3txG~ZFNdo@0qQ)_Jyw5=enkyXq$Sx
zb^fKkdFT38Uzxk&-0aOamT$Ve92n!^m>(q=6o0ZXGB7M>&;f-7C{HkO{Acjzl=0ZG
z;9xU{pxi6x=jY^uID~UIHMa*Vw=8D)`SJ3}z=Q6Ui@r=qROXNjU{(CM@zLUAOB6F~
zBza2MI{D>gt1!cp)rG8U`UxmoYWHpBcs!TZFx5Htjju6KRjyRD3j=4?DkM$?|Gd(}@
z!`kJUrmf{aCdQIi9n357Q@A--Qi+2C~3
zjg8(L1S?iD<=v3GGDk`{>A-ttPquA_jt|P4)LDW>e&jlwIN&AObJ*^|q6JI&&nBun
zEx6d0ASrk`QQAVW=7Fe~n3M;DV`rJ8kGYA%42LAopG~P}8W@@R3qCkkv*re#6irkq
W>5`0Z*x1&bS#r@;jg^&!!5RQ87?k4x

literal 0
HcmV?d00001

diff --git a/images/index.php b/images/index.php
new file mode 100644
index 0000000..75b5c09
--- /dev/null
+++ b/images/index.php
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Z48DDLNF*w{SY}77D6($d5gSA0*)}OFIu0u
zAnI3XcO*_fHd)N{-njb5d_>_|v6)L&2<~JjBK2&-pIDrV*sGCVrB1Pw%TdN6_!#Lst-xuf?P#0RX*?jqxH{GXJ4O#vBmt)xpalcoSexgP
zRwieX<4i2`CxuTKl_{bF?#pm4K{#a5fq<`dd3;QpZE^b$D(sUfP%czzm{#_okY0okBI*ni
zYRHjyhp?a|iBmTq56E$YA>x3XFFfc42-31I65*2gl1j7u5c$g2-}1KKC!mTn4a5ls
zABge*Wbh*FWFG7!1H?I%ZoWugd68~snj=hy@vFhVyhtaph(yBO`{7skt0@|cbnU0<
z`0<1fLHFmK9xg;aTq=6F-1TsE>fw)n57{r%XT%zRXg1E*r=KcnZ0>5@?y5Y3O$rpu
zFxULQ6kGEuvRT~~o?5;Jy46eid5I%oxF#5`$@&Z3Zi>!Z+$0fIjdre_9R>@7b$8NQgF&*(*9f{5z$x$7t8677xnlrQ>
z-CC)-ef1Glt20}%Gc&4FQ?Y%ks8j6~j7aOGVY(``x~iPJs-wDUi@WN(yYBP0Z%O2<
zE_W4Sx`V~LudQ^^74uuByJ(8{ZcLw)p||fTwkAa#gHb(0#XT>(dxocbMzlJ#Xs|b0
zkKa2#9*=rFiRsAT?U-I^|G3ruX}bOM)yH8PNoVQcetgezckhSk-XB}NY|I|8)%kyj
zt>P0oI<#GU5JNk#f?-4!KiMO;sAvXP34^DH!8gpXorgz}01)66a_JL^?h`BNlaS;B
GwEhnOGQM2^

literal 0
HcmV?d00001

diff --git a/images/logo.jpg b/images/logo.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..f5205e6bd9e43c42c9c37054620f4f375283f5c9
GIT binary patch
literal 11413
zcmb_?byQp1w{@^$#oddfI28Bd5`rbTloq=*xRzptBE>CuA-HRCFSNy_6n6>)_d;s!5I`tz?QCfSu~YX6AqM+3&jmBsc&tdMyST3jm!24TA*jz8g>h0HC8|
zprN6B{;OePJwV66M#Dk-yZsABy`!OHU}6yi&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%vS@_@2_x}&a{!`#P7^Qr0 z{j7iWt^c@r9~_+YZ~o$gZZYYS?*HyRSX}G<@A206Pp|!ZdE|kG#Ct=#HRXm|IaUA1 z3qClu;Qv1V_xlSjoV&1T_1XtLG82p}FQ`~PsL@)(r}O^8)e9|?4=&yIV4Cdz&4%wE zoY=H%-u#6QC^dsiB4*mNjaYTklHI|VrRosls=e3(n{_>TTPXU^DZUN|Imr8g=5 z#$E-UXNGqU=_hS}uswRN;d4faxgpv^LT4dsf{L}r1O)|FMsAh~kv)xTSmk{T z*&obha_sNi8^QD`RJfQ|j=lKyn@o<{$V*0NQ?hEp64q>8Qhr0ohx1r&li|e&3b7U+ vc1;)MNK(>hT;|Zw>ak5(G@|f<17p}kogATtqyy>?nngP0_n+`lV6X-Ns<=sx literal 0 HcmV?d00001 diff --git a/images/nopic.png b/images/nopic.png new file mode 100755 index 0000000000000000000000000000000000000000..10f5ca42c560ce114d7df202364780ba5a235673 GIT binary patch literal 2967 zcmV;I3uyF-P)^@RCwCV zTKQ`n*B$@PUbDM1duw-fS&|*e@*y|m2fGk~2@Zu~NGXN1p@c$6{{_=D#6J|-4Iz}Y zm>#62#p!{el(x7fv}q}%O{min<6v7NmgGan>RM^`5s;YWek|f(>k-l0@77B&Mxw*NIu3o+R-m4cc{tMj+ETqzM zGh1N0;bH*?&Ye5=d?u5*)%Xlt^?JQ_`}Xah_4f9TL$=uci3#F{pG4COFQW}zzkdDu znx>U7u<==HQ0Vl93m0Bw1?v}}ccGp;lamvpqoaHiHTGfpaym`rT#oA1DpiY*+*bDc z3GOGpU8=e-w^CH~iEq8~%4I0`rJ?iZtBu!QOK`u$+K12gUb}YfrL$+xUfAozrHu_r z&(BjKnIwnZPEMDLY&IL&oz6!-T`mi4RVx*0U?FOEH!0C5xr4#IE2&&w8Xq5j;l_;{ z|HPa%MimME_4M88>EFq+9PMspzXBP_p^z!91E|)7Rf}+jEn$AGu4G7>11jrc*?fllscpI$5 z3+AT5BAJH|DZjc({=Po)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9deb75f42ad379978c2c2040d55cc1eeacf98 GIT binary patch literal 733 zcmZ?wbhEHb)MVggc*Xz%|A9bL^Oug!XG6pPCMNGpO<$Xvf3voJX=(Y;&hDOr!wVOe zn=URlTwJcXy8e%k|C^9-%FpjtQqoC({~yW8-&0e+rKWyOOZ$|O@jff-eRlSVsHlBm zVSB^FU*zTOj*NU(Q1Gmz0wwRbl#l>4iXc-7PQQ7$3hoGxJ(a&851!3k?nD zo0`rwH=k>5J=@)VcEW_S6DOXVGUeRVspqCmJ2!LYrKL-+u3dY5{rU?RE}TDq{@l59 zXV0EJbLPzH)2C0JI(72o$rC3|96x^i*s)_rj~+d8bLYY{$Edd_R$B(;sd$)Kv*;-$;wsmo9GL_%E zf1j|9Rg;(JiN`Mfb2A-XFI>84>tU0rFLC>}l6g~r+vCR%n>-!f+~C}}Z4uMncdlf z@!*OYBUkI0ijBWMpPI3-+3G;Z%d9IWMVB^vcmxzEI5zWHUG96i$n~_iQ2}S;MI%

WwD=QEU02C%n4J_{O?hQ;q06Sz+xVr!V literal 0 HcmV?d00001 diff --git a/images/short_of_stock.gif b/images/short_of_stock.gif new file mode 100644 index 0000000000000000000000000000000000000000..483fb9ba05bf29d0b8645b73c40292f604677f09 GIT binary patch literal 1135 zcmZ?wbhEHb)MVgg_|5={0zt*ySUd8i&6Yskfg6~&}yk0Kya+&y>m68t^ z%iUX~_;k7Qi&d&`)~erJpnhY4#=WK5*A{5rS*m+ysowuX4u20hotka-`;hCegRUoM zoBufA{_~*6_x&Ch7ukM4;Pq|4*Vp~tUk~_x+3)vhpYNyrK_5XVc;9rV* zEBx4e?^k=HpY4o%xhH1(6whr_ydLd{eYPiI%VeJe^Mdxz4cRo=@9wtbjg$QM%?*3B zJAKcbh~0A{Z|y9+v?=e>=DZ7=3a;-cxwfP1{HBs~n@Xxtw3>_iSg>%RRA&=LH;?8+>4H$euZoN0uaB z+njxKNAcAi)#o;qpWD%O^}v+t$CsZwckb-jvuDnnIeq%{sZ*y;o;-Qt#EIj_j~_jH z^vIDThYue(;GXwrttFdGp4N8#ip&uzvmeb?erx zUAuPW%9SfttN=z7IL1Z^s)c~!PZmZ7hJFSekcpr?!NBpKL7r2_W5a@j%^ZSmjlwA% zle9RNt0)Ggbc(iA{9|DHvfS^WwtK>i9|}r6d}^#46)b}vd3Olg&XV|ZSpEE5>#9FL z6f;zK+PEF`a~6DTc`#eVzBy|JW9x(YwxusTmL|9R%QqHAsqkuroRDb@ipvRorPh7G zre=}f)U4^IS+&EMDxmlj+bjiy*l1$Q#T}-(#d!sHaa@XPGnBiM()+)<%QDH^w?n6?I zy&SAkelE>?gWD%9u>$vD3$vfk+kKTcW4|w&jWM(rm zRxMcUe5;e&sio#Y4-b!!M#loCaz~j2ivvfQgx6eIp9yYi3nOx#%VPa)rum%9rBBCb% literal 0 HcmV?d00001 diff --git a/images/status/alert.gif b/images/status/alert.gif new file mode 100644 index 0000000000000000000000000000000000000000..012361b0bc427b108f9f41dd7ebbf7a3d2190ae8 GIT binary patch literal 161 zcmZ?wbhEHb6krfwSj52a|NsB@EiKoq3>g?0{xLEENeEE<&+X?L671|4;A*62z|05~ zRs6}qV#DyCK?kG)q@96Tg=6!bwaOSNM?l&j)#a9{w7#OSpwGJ9J literal 0 HcmV?d00001 diff --git a/images/status/busy.gif b/images/status/busy.gif new file mode 100644 index 0000000000000000000000000000000000000000..406f04994be999dea872e31495eff36275eb49ef GIT binary patch literal 229 zcmZ?wbhEHb6krfw*v!E2|BUhXqlWMI8s6J#cyy`Zlw!^7D9vkDhE7(BhMJ0+nuKad0h#sA!Xt|7tBjsdPldIrplAfcZutTqh13_2irkg*Ib?i)6GW>4jLan|&0 zg8|FkBb=ueDb3lr^jLzF)-Csvni KdKxUqU=08p15qIW literal 0 HcmV?d00001 diff --git a/images/status/dunning.gif b/images/status/dunning.gif new file mode 100644 index 0000000000000000000000000000000000000000..85979960c02461e6dee016df5676e7f9f044df10 GIT binary patch literal 82 zcmZ?wbhEHb6krfwn8?8JrnQxUf#LuE|3FglCkrDx0~3P|kPVa-U|?WU4(XdI_JCiu j>&x6I{l2Q(&uSN1FvV6>z1)_R`^|}c@s-8^1_o;Ym^~TC literal 0 HcmV?d00001 diff --git a/images/status/index.php b/images/status/index.php new file mode 100644 index 0000000..3a6074a --- /dev/null +++ b/images/status/index.php @@ -0,0 +1,20 @@ +%(B1H=FS|AD09PZmaY1||j_AR8zvz`($y9MU&a>;b=Q j*O$3b`h8WmpVcn3V2Z7%dbuqr_nQ;@;wy~-3=Gx)rV|SNM?l&j)#a9{w7#OSp!LAx+ literal 0 HcmV?d00001 diff --git a/images/status/paid.gif b/images/status/paid.gif new file mode 100644 index 0000000000000000000000000000000000000000..bcdce276b11cf42cd176c4dea9ca36677b1ce2e5 GIT binary patch literal 82 zcmZ?wbhEHb6krfwn8*MEGr!FE|NlRbq4<-9k)45wK?fuXl4oF27U`SG_K;t;>&x6I f{l2Q(&uSN1u*FtXz1)_R`^|}c@s)-E1_o;YlIR(# literal 0 HcmV?d00001 diff --git a/images/status/reminder.gif b/images/status/reminder.gif new file mode 100644 index 0000000000000000000000000000000000000000..85979960c02461e6dee016df5676e7f9f044df10 GIT binary patch literal 82 zcmZ?wbhEHb6krfwn8?8JrnQxUf#LuE|3FglCkrDx0~3P|kPVa-U|?WU4(XdI_JCiu j>&x6I{l2Q(&uSN1FvV6>z1)_R`^|}c@s-8^1_o;Ym^~TC literal 0 HcmV?d00001 diff --git a/images/status/shipped.gif b/images/status/shipped.gif new file mode 100644 index 0000000000000000000000000000000000000000..97f527f9ef0f94c094de1b4ed6d53310ceac52ec GIT binary patch literal 82 zcmZ?wbhEHb6krfwn8?8J|L;r&Ao>44kW~E1!pP3R#GnIY17!sm7?_kp`euqf;Fsw{Pgzu_Vo1hC@Bn zebnr}(e9|!=g7?QcFgUk%I<~6?RL%L!^h^E*xJ^@>}<*4y1(M0zvGj*=6AX1WX0RV zy60=c+_SRfTe0G7wcV4s+MloCWwG6dw%DDy)vBuDRLaWAsoQ$8)S9l=lB(E)quObs z-c6m`Nt)V2tIVC9*I1d>UZ>5Do788Q*g>husF%}Sl+{U+);y8ZP@T$xoy3=r&_|2W zM!2}Rn8$pQ%V&wwG>pwmhtENS&NqV3EQQKLh{jof$vla{XNJX1eaSO=%Osb!j(W)| zeZoU>#~gaWJ$b`5bHpcizdCioFLl8)g|=vNzb?AXlAx3a;sf#tWj#NL}#uwT(T5lt}bh&W@MmLV53D?rzT{aXGWMJO^-=NjX5@e zG$nH@|Ns900000000000000000000000000000000000000000A^8LW2LN;cEC2ui z03QG!000O7fOLX`gd0w7aC3@qZcZD7kdcA{Hg0ljVm2EI8!%j!ZZ-mvksEGtVjT&q ztgIbkac+;Kf;Mn#B@GP{79AZSz7`S<2_3AVZ3z5yZ<30A;+G!4jvP8ZutaAh~fvhRvHeWgzKt5&!@* zX}pjjLq|f!GiZhk(ZRH-(;-m4?C?po%^8*wc(Cab1`QJ;V2St`OO^-}GgGMoSb-)? z7dAZqxRg0F1`L%eSEdx%8@RPu zR_QEw$Cxdy)vhpNWO!^XRnD{lT7^oK70u6N_Bld``Rc@}NJ+CXjg%zA!K)n)U_p%< zInEDHvR;XbG*ArD1a%__rWOV*wBW)EIpkN}5bLSXKpRpFVV)2f~Y!L$sF0^2R2O2y800Rz$=|BWZeyAV|F=P=$0D~-0#Stugu%!kS zMBsn|c;e{*l1rNK0SiY|u>d3&WYNP18E`=7oeCJ>r~wM>sR0KWe9%J{Qbq!T6*^=P z0R&+-TEM7~jtM~o8R%dI2((;~L=PE20KowVjA|>bvS!dj5}DGn01ZsUFzW#X6k9B= zF)%^HpppnM00PibFvAj0;2^@R1RM~72sk{k#0(Tbi@*RD3Gyrg6r6Cv4?j48MHg9U UA#WC4VBrM2>V`Y6Ab|h?JD$<@Bme*a literal 0 HcmV?d00001 diff --git a/images/transparent.gif b/images/transparent.gif new file mode 100644 index 0000000000000000000000000000000000000000..6ec45e58fcccd70b4f32ab9483af09284b4fbad2 GIT binary patch literal 43 wcmZ?wbhEHbWMp7uXkcLY|NsAvxe|&$Ss2+F7#MVb7%0xjz`(@h!pL9^0Pg4rZ2$lO literal 0 HcmV?d00001 diff --git a/images/visa.gif b/images/visa.gif new file mode 100644 index 0000000000000000000000000000000000000000..1073e793a63a454dce5011f9aeffcd69d7ae4d04 GIT binary patch literal 335 zcmZ?wbhEHbRAmrlI3mb!7Kpd z--WK0xd#{-8UN4Y|Ns9#mvsY>WFQ(S{$ycfU=U=`0qFqQ$-sIhLBupAb6!SOR}!;9 zfzJ7ovkbh}Mgi~tA6Ou8=)^{;JqwFGO}0%s^J4u9XRr0PuRb1pTeUxifq|#2Z%>;; z{+VD0wx;-ph6;UqpRrZsHfUVQa$#cR_vA_qO~_-&s}(2|U}WKE$*=2(j?c5yEJtc*;_~f!sZoZ3` zE?>ENjgPzX!u30MZ```~@aoO;kDl>yK5^&Ze*5nIhmW7QIV!cj|IijxWUvMR3qpd6 literal 0 HcmV?d00001 diff --git a/index.php b/index.php new file mode 100644 index 0000000..55fa763 --- /dev/null +++ b/index.php @@ -0,0 +1,20 @@ + to the success page + (reported by bolengo) + + [payment_methods/paypal/post_data.php] Bugfix: Round amount sent to PayPal to 2 digits after the decimal point + (reported by tschiemer) + + [payment_methods/payment-network/post_data.php] Bugfix: Removed group of thousands separator in amount + + [install.php] Bugfix: Changed default value of field free_shipping in the db table mod_bakery_general_settings + from 9999999 to 99999.99 (reported by daydreamer, thanks to jacobi22 and marmot) + http://www.websitebaker.org/forum/index.php/topic,26484.msg182112.html#msg182112 + + Fixed some php mysql functions since they are deprecated as of PHP 5.5.0: + - mysql_insert_id() replaced by $database->get_one("SELECT LAST_INSERT_ID()") + - mysql_error() replaced by $database->get_error() + + Bugfix: Fixed a bug that stopped saving new images in the database when clicking "Save & Back" + (reported by jacobi22 and instantflorian) + http://www.websitebaker.org/forum/index.php/topic,26497.msg192755.html#msg192755 + + [payment_methods/paypal/ipn.php] Updated PayPal IPN using cURL library to comply with TLS protocol + since PayPal discontinued support for SSL 3.0 support on december 3, 2014 (reported by N1kko) + This is due to the POODLE SSL 3.0 vulnerability + http://www.websitebaker.org/forum/index.php/topic,27799.msg193340.html#msg193340 + + v1.7.0 (Christoph Marti; 08/24/2013) + + [upgrade.php] Bugfix: Added database fields created_when and created_by to the mod_bakery_items table + (reported by instantflorian) + + [payment_methods/paypal/post_data.php] Bugfix: Changed order total posted to PayPal + from type string to int to stop PayPal moaning about number format (reported by instantflorian) + + [config.php] Added thumbnail default sizes (modify page settings) + + [save_item.php] If image alt is left blank, Bakery uses (if provided) 1. image title or 2. image caption + + [languages/CS.php] Added Czech language file (thanks to dana) + + [payment_methods/paypal/ipn.php] Updated PayPal IPN to comply with HTTP 1.1 protocol since + PayPal discontinued support for HTTP 1.0 starting february 1, 2013 / october 7, 2013 (reported by paulchen) + + v1.6.9 (Christoph Marti; 04/13/2013) + + Added code to not let prices in the cart undercut zero (reported by jacobi22) + + [save_item.php] Fixed changing item attributes (reported by jacobi22) + + [modify_item.php] Fixed move image up arrow-link + + Changed sorting of item attributes to natsort using mysql order clause + ORDER BY LENGTH(a.attribute_name), a.attribute_name + + [search.php] Made free definable fields searchable + + v1.6.8 (Christoph Marti; 03/27/2013) + + Added config.php file for some additional settings + + [modify_item.php] Limited lenght of item image filenames (can be set in config.php) + + [modify_item.php] Too long item image filenames will be wrapped in order to fit the table cell + + [view_item.php] For item detail templates built with a table wrap selects in a table row + Affects item options selects => [OPTION] placeholder + + v1.6.7 (Christoph Marti; 03/24/2013) + + On item detail pages added code to truncate long pagination links and add … (horizontal ellipsis) + + [calc_price.js] Fixed jquery function in case the option price is neither '-' nor '+' but '=' + + [save_item.php] Bugfix: When duplicating an item the link to the origin has been saved in the db + + v1.6.6 (Christoph Marti; 03/17/2013) + + [view_cart.php] Bugfix: Fixed display of main image in cart (reported by jacobi22) + + Replaced ampersands by its entities & in some non-js url query strings (reported by jacobi22) + + [modify_item.php] Added note that the image at the top position is used as main image (reported by jacobi22) + + On item detail pages added code to truncate long pagination texts and add a horizontal ellipsis + + [calc_price.js] Fixed jquery function in case the option price is neither '-' nor '+' but '=' + + v1.6.5 (Christoph Marti; 03/13/2013) + + Improved item image ordering and added image data as title, alt, caption and item attribute assignment + + v1.6.4 (Christoph Marti; 01/21/2013) + + [languages/states/GB.php] Added state file for United Kingdom (thanks to kbob) + + Bugfix: Changed db field shop_state to VARCHAR(5) to fit longer state codes (reported by kbob) + + [languages/EN.php] Amended the english language file (thanks to kbob) + + [languages/EN-GB.php] Added British english language file (thanks to kbob) + Must be invoked manually by changing the filename EN-GB.php to EN.php + + Wiped out some depreciated code snippets (reported by stefek) + + Updated lightbox2 js to version 2.51 (reported by zirzy) + http://www.websitebaker2.org/forum/index.php/topic,21500.msg144767.html + Used modified version by kpull1 that allows to set options outside of the scriptfile + + Added jquery plug-in to calculate price change depending on selected option (thanks to neuling and marmot) + Restrictions: Only works on item detail pages + http://www.websitebaker2.org/forum/index.php/topic,24695.msg168375.html + + Changed PayPal PDT from php fsockopen() to curl lib + + Bugfix: Fixed pagination on overview page + + Altered back button on detail pages so now it jumps back to the overview page where you left + + On item detail pages altered previous and next linktexts to show according item titles + + Deleted last closing php tag on all php files + + [save_item.php] Changed sequence of item data saving: + 1. Save it in database, 2. generate wb access file, 3. save images / thumbnails in media directory + + v1.6.3 (Christoph Marti; 11/18/2012) + + [check_vat.php] Added code to check if soap extension is loaded (reported by jacobi22) + + [check_vat.php] Added exception handler to the soap request to prevent fatal errors on simple network issues + + [view_item.php] Bugfix: Initialized 2 vars to prevent a notice about undefined variables (reported by jacobi22) + + [save_form.php] Moved variable $add_chars from language files to save_form.php (reported by jacobi22) + + [save_form.php] Added special chars to the address form regexp (reported by jacobi22) + http://www.websitebaker2.org/forum/index.php/topic,23005.msg169605.html + + v1.6.2 (Christoph Marti; 11/13/2012) + + Completely reworked Bakery checkout process + (new sequence: 1. address form -> 2. payment method -> 3. summary -> click to buy) + + Added new payment method "cash on delivery" + + Removed payment method "mollie" + Please use third party iDEAL gateway provided by ideal-checkout.nl + + Adapted all included payment methods to the new Bakery checkout + + Removed feature to skip checkout if only 1 payment method is selected + + [images/checkout_steps/] Changed checkout images from .gif to .png + + Added textarea for customers message on payment method page + + Added consecutive numbering of invoices (order id ≠ invoice id) + + Updated and improved the Italian localisation (thanks to Kwb) + + [languages/states/AU.php] Added state file for Australia (thanks to Darren Brack) + + v1.6.1 (Christoph Marti; 10/26/2012) + + [templates/cart/table_header.htm] Bugfix: Fixed


inside of

tag (thanks to gearup) + + [templates/summary/table_header.htm] Bugfix: Fixed


inside of

tag (thanks to gearup) + + [add.php] Bugfix:

is not allowed in elements (thanks to gearup) + + [view_form.php] Bugfix: Corrected wrong spelling MAXLENGHT to MAXLENGTH (thanks to gearup) + + [templates/form/form.htm] Bugfix: Corrected wrong spelling MAXLENGHT to MAXLENGTH (thanks to gearup) + + [payment_methods/paypal/ipn.php] Improved email string comparison of receivers email address validation + (thanks to instantflorian and marmot) http://www.websitebaker2.org/forum/index.php?topic=24445 + + Added support for company name in the customer and shipping address forms + + v1.6.0 (Christoph Marti; 06/17/2012) + + Resaved all bakery files using charset utf-8 + + Replaced function utf8_encode() by utf8_decode() in all language files + + [view.php] Bugfix: Added code to prevent entering negative item quantities when updating the cart + (reported by ronald32) + + Added support for EU tax zone (based on patch by syncgw, thanks to syncgw) + http://www.websitebaker2.org/forum/index.php/topic,21690.msg145849.html + + Added placeholder [CUST_TAX_NO] to emails and the invoice + + Added support for German "Button-Gesetz" (based on patch by instantflorian, thanks to instantflorian) + http://www.websitebaker2.org/forum/index.php/topic,23974.msg163127.html + + [languages/states/FR.php] Added state file for Italy (thanks to Kurry) + + [mini_cart.php] Changed MiniCart displaying the note regarding sales tax depending on general settings + (reported by instantflorian) + + [view_form.php] Bugfix: Inactivated deprecated code that stoped droplets working on the address form page + + [view_pay.php] Bugfix: Inactivated deprecated code that stoped droplets working on the address form page + + Added items drag&drop (based on patch by stefek and CrnoGorak, thanks to stefek and CrnoGorak) + http://www.websitebaker2.org/forum/index.php/topic,20267.0.html + + [upgrade.php] Added support for $database = WbDatabase::getInstance() started at WB Rev. 1682 + by keeping downward compatibility + + v1.5.9 (Christoph Marti; 12/11/2011) + + [view_form.php, view_pay.php] Bugfix: Added support for WB function getOutputFilterSettings() + introduced in WB 2.8.2 SP2. It replaced the former function get_output_filter_settings() + + Bugfix: Replaced all ereg(), eregi() and ereg_replace() functions by strpos(), preg_match() + or preg_replace() as of PHP 5.3.0 the regex extension is deprecated in favor of the PCRE extension + + v1.5.8 (Christoph Marti; 10/24/2011) + + [view.php] Bugfix: Fixed state code validation to accept alphanumeric characters + (reported to elarifr) + + [languages/FR.php] Bugfix: Rectified translation of $MOD_BAKERY['TXT_SHOW_STATE_FIELD'] + (thanks to elarifr) + + [view_cart.php] Bugfix: Use function getimagesize() with image path since + url does not work properly if php ini option allow_url_fopen is set to 0 (thanks to chio) + + v1.5.7 (Christoph Marti; 03/27/2011) + + [languages/countries/EN.php, languages/countries/DE.php] Bugfix: Rectified country code of China + (reported to syncgw) + + [modify_orders.php] Minor modification to support the payment status 'busy' (requested by Ruud) + + [payment_methods/load.php] Added possibility to add install.php/upgrade.php files to a payment method + (requested by Ruud) + + [view_summary.php] Bugfix: Rectified the term for free shipping on summary page and invoice + + [view_item.php] Bugfix: Fixed pagination on item detail pages in case of inactive item(s) + (reported by Donald169) + + [view_item.php] Bugfix: Replaced hardcoded page extension '.php' by wb constant PAGE_EXTENSION + + v1.5.6 (Christoph Marti; 06/07/2010) + + [view.php] Bugfix: Added code to exclude the cust_confirm_email field in the mysql update string + (thanks to syncgw) + + v1.5.5 (Christoph Marti; 06/01/2010) + + [save_general_settings.php] Clean out protocol names, if added to the shop name + in the Bakery backend, to prevent problems with the php mail() function + + [view.php, help.php, mini_cart.php] Replaced nested mysql selects by a mysql join statements since + the nested select failed on some mysql server versions + + [uninstall.php] Bugfix: Replaced hard coded Bakery pages directory by the one + saved in the general settings + + [search.php] Bugfix: If no main image is defined there will no longer be a thumbnail displayed + in search results + + Added FR language files: module, country list, state list, payment methods advance and invoice + (thanks to quinto) + + Improved the 'payment-network' payment method (version v0.2) + + Added support for notification password used by http-response notification + (requested by Payment Network AG) + + Added email confirmation field to the address form (thanks to copta) + + Fixed some small issues (thanks to Ruud) + + [view_overview.php] Rectified unclosed tag and incorrect thumb html string + + [view_summary.php] Set default state for countries without a state file + + v1.5.4 (Christoph Marti; 04/08/2010) + + [view.php] In case 'No out of stock orders' is set as general setting + and a customer puts a sold out item into the cart it will no longer be inserted into db + + [save_item.php] Bugfix: Added missing curly brace (reported by MCoffman and frododendron) + + v1.5.3 (Christoph Marti; 04/07/2010) + + [view.php] Added support for MSIE image buttons (that just submit the click coordinates) by + converting POST names from 'anything_x' to 'anything' + + [modify_item.php] Bugfix: The move/duplicate item dropdown menu occasionally displayed + improper item page therefore items were moved to other pages + + [save_item.php] After duplicating an item Bakery now jumps to the duplicated item + + [stock.php, save_stock.php] After saving changes to the stock admin page Bakery now retaines + the selected category (=section) + + [languages/states/CA.php] Added state file for Canada (thanks to mjm4842) + + [view.php] Bugfix: Removed some doubled

tags from error messages + + Bugfix 'paypal' payment method (version v0.4) + + Clarified error message in case Bakery fails to connect to the PayPal server (reported by ms) + + Made some other small fixes and improvements to the payment method code + + v1.5.2 (Christoph Marti; 03/19/2010) + + [save_item.php] Added code to replace triple page spacer by one page spacer in item urls + + Bugfix 'paypal' payment method (version v0.3) + + Rectified PayPal return url provided by the Bakery backend to stop PayPal moaning about + improperly formatted return url (reported by westjoneff) + + [delete.php] Bugfix: When a page or section gets deleted, the associated item attributes in the db + will be deleted as well + + [save_item.php] Bugfix: When saving the item options sometimes they were duplicated accidentally + (reported by instantflorian) + + v1.5.1 (Christoph Marti; 03/13/2010) + + Added a loader icon to the direct checkout which is displayed before redirecting to + the payment gateway (currently only PayPal and Payment Network) + + Bugfix: Changed some not closed tags to xhtml standards-compliant + + [templates/cart/table_body.php] Bugfix: Fixed an empty img height="" attribute that made IE display + the cart thumb as a line. Img width and height is now calculated by Bakery + (reported by vm12, thanks to Thomas Zobrist) + + [view_confirmation.php] Bugfix: Improper use of single quotes which leads to variable name + displayed instead of email address (thanks to proglot) + + [stock.php] Improved the item overview by adding category (section) filter to the stock admin + + Improved the item image upload (thanks to stefek) + + Upload image can now be selected as main image before uploading + + Fixed number format of prices at overview and item detail pages (reported by instantflorian) + + Linked cart item thumbs to item detail pages (suggested by t0nno) + + [view_summary.php] Bugfix: Added round() to fix an issue with incorrectly formatted order total + amounts submitted to payment gateways (PayPal reported by itsnick, Mollie reported by ruud) + + [view_item.php] Bugfix: Fixed the previous/next item navigation to jump inactive items + (reported by instantflorian) + + Bugfix: Fixed the item attribute price calculation if an attribute is set to '=' + (reported by instantflorian) + + [modify_item.php] Added submit buttons which save and return to the same page + (suggested by instantflorian) + + Added SEO feature that admits to rename the Bakery pages directory in the general settings + + v1.5.0 (Christoph Marti; 01/12/2010) + + [modify_item.php] Changed the order of the option price operators from '=/+/-' to '+/-/=' + to prevent misentry by using the default value '=' with an option price left blank or equal 0 + + Prettyfied code by applying some code standards + + [search.php] Bugfix: Display of thumbnail in search results (invented in v1.3 + by multiple item images) + + Added thumb display to the cart + + Bugfix: Rectified the use of

'."\n".$invoice."\n
\n"; + $html .= ''."\n"; + + // Remove all "\r" in emails to avoid double line breaks + $html = str_replace ("\r", '', $html); + + // Make email headers + $headers = 'MIME-Version: 1.0'."\n"; + $headers .= 'Content-type: text/html; charset="'.$charset.'"'."\n"; + $headers .= "Return-Path: $shop_email"."\n"; + $headers .= "Reply-To: $shop_email"."\n"; + $headers .= "From: $shop_name <$shop_email>"; + + + // Premailer => bring css inline + // @link http://premailer.dialect.ca/api + // @link https://gist.github.com/barock19/1591053 + require_once('library/premailer.php'); + $pre = Premailer::html($html); + // $html = $pre['html']; + // $plain = $pre['plain']; + + + // Send invoice email to customer + if (mail($cust_email, $email_subject, $pre['html'], $headers)) { + // On success view confirmation + $database->query("UPDATE `".TABLE_PREFIX."mod_bakery_customer` SET `sent_invoices` = `sent_invoices` + '1' WHERE order_id = '$order_id'"); + // On success increment email counter + $admin->print_success($MOD_BAKERY['TXT_INVOICE_HAS_BEEN_SENT_SUCCESSFULLY'], WB_URL.'/modules/bakery/modify_orders.php?page_id='.$page_id); + } else { + $admin->print_error($database->get_error(), WB_URL.'/modules/bakery/modify_orders.php?page_id='.$page_id); + } + } +} + +// Print admin footer +$admin->print_footer(); \ No newline at end of file diff --git a/stock.php b/stock.php new file mode 100644 index 0000000..fb72cc5 --- /dev/null +++ b/stock.php @@ -0,0 +1,186 @@ + 2.7 +// Check if THEME_URL is supported otherwise use ADMIN_URL +if (!defined('THEME_URL')) { + define('THEME_URL', ADMIN_URL); +} + +// Look for language file +if (LANGUAGE_LOADED) { + require_once(WB_PATH.'/modules/bakery/languages/EN.php'); + if (file_exists(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php')) { + require_once(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php'); + } +} + +// Get cat (category) and make query clause +if (isset($_GET['cat'])) { + $category = is_numeric($_GET['cat']) ? $_GET['cat'] : ''; +} elseif (isset($_POST['cat'])) { + $category = is_numeric($_POST['cat']) ? $_POST['cat'] : ''; +} else { + $category = ''; +} +$clause = $category != '' ? " AND section_id = $category" : ''; + +// Bakery page list +$query_pages = "SELECT p.page_id, p.page_title, p.visibility, p.admin_groups, p.admin_users, p.viewing_groups, p.viewing_users, s.section_id FROM ".TABLE_PREFIX."pages p INNER JOIN ".TABLE_PREFIX."sections s ON p.page_id = s.page_id WHERE s.module = 'bakery' AND p.visibility != 'deleted' ORDER BY p.level, p.position ASC"; +$get_pages = $database->query($query_pages); + + +// Generate sections select +if ($get_pages->numRows() > 0) { + $sections_select = ''; + while ($page = $get_pages->fetchRow()) { + $page = array_map('stripslashes', $page); + // Only display if visible + if ($admin->page_is_visible($page) == false) + continue; + // Get user perms + $admin_groups = explode(',', str_replace('_', '', $page['admin_groups'])); + $admin_users = explode(',', str_replace('_', '', $page['admin_users'])); + // Check user perms + $in_group = FALSE; + foreach ($admin->get_groups_id() as $cur_gid) { + if (in_array($cur_gid, $admin_groups)) { + $in_group = TRUE; + } + } + if (($in_group) OR is_numeric(array_search($admin->get_user_id(), $admin_users))) { + $can_modify = true; + } else { + $can_modify = false; + } + // Options + $sections_select .= "
+ + + + + + + + + + + fetchRow()) { + $item = array_map('stripslashes', $item); + ?> + + + + + + + + + + + + +
/> + + <?php echo $TEXT['MODIFY']; ?> + + + + <?php echo $TEXT['DELETE']; ?> + +
+
"; +} + +// Show buttons +?> + + + + + + +
+ + +
+ +print_footer(); diff --git a/templates/cart/empty.htm b/templates/cart/empty.htm new file mode 100644 index 0000000..0a20cdf --- /dev/null +++ b/templates/cart/empty.htm @@ -0,0 +1,7 @@ + +
+

{ERR_CART_EMPTY}

+
+

+
+
\ No newline at end of file diff --git a/templates/cart/error.htm b/templates/cart/error.htm new file mode 100644 index 0000000..f5cbd42 --- /dev/null +++ b/templates/cart/error.htm @@ -0,0 +1,10 @@ + +
+{MESSAGE} +
+

+ +

+
+
+
diff --git a/templates/cart/index.php b/templates/cart/index.php new file mode 100644 index 0000000..3a6074a --- /dev/null +++ b/templates/cart/index.php @@ -0,0 +1,20 @@ + +

{TXT_UPDATE_CART_SUCCESS}

+ \ No newline at end of file diff --git a/templates/cart/table_body.htm b/templates/cart/table_body.htm new file mode 100644 index 0000000..31561d3 --- /dev/null +++ b/templates/cart/table_body.htm @@ -0,0 +1,11 @@ + + +
{NAME} + {SKU} + {NAME}
{ATTRIBUTE} + + {TEXT_DELETE} + {PRICE} + {SHIPPING} + {TOTAL} + diff --git a/templates/cart/table_footer.htm b/templates/cart/table_footer.htm new file mode 100644 index 0000000..dd2a241 --- /dev/null +++ b/templates/cart/table_footer.htm @@ -0,0 +1,25 @@ + + +
+ + + {TXT_SUM} + {SETTING_SHOP_CURRENCY} {ORDER_TOTAL} + + +
+ + + + + + + + + +
+ + + + + diff --git a/templates/cart/table_header.htm b/templates/cart/table_header.htm new file mode 100644 index 0000000..354d00d --- /dev/null +++ b/templates/cart/table_header.htm @@ -0,0 +1,20 @@ + +

{TXT_ORDER_ID}: {ORDER_ID}

+
+
+ + + + + + + + + + + + + diff --git a/templates/cart/title.htm b/templates/cart/title.htm new file mode 100644 index 0000000..8971611 --- /dev/null +++ b/templates/cart/title.htm @@ -0,0 +1,2 @@ + +

{TXT_CART}

\ No newline at end of file diff --git a/templates/confirmation/canceled.htm b/templates/confirmation/canceled.htm new file mode 100644 index 0000000..049b44d --- /dev/null +++ b/templates/confirmation/canceled.htm @@ -0,0 +1,8 @@ + +
+

{CANCELED}

+ +

+

+ +
\ No newline at end of file diff --git a/templates/confirmation/email_error.htm b/templates/confirmation/email_error.htm new file mode 100644 index 0000000..7a2c746 --- /dev/null +++ b/templates/confirmation/email_error.htm @@ -0,0 +1,4 @@ + +
+

{ERR_EMAIL_NOT_SENT}

+
\ No newline at end of file diff --git a/templates/confirmation/error.htm b/templates/confirmation/error.htm new file mode 100644 index 0000000..f340a92 --- /dev/null +++ b/templates/confirmation/error.htm @@ -0,0 +1,8 @@ + +
+

{ERROR}

+
+

+

+ +
diff --git a/templates/confirmation/index.php b/templates/confirmation/index.php new file mode 100644 index 0000000..3a6074a --- /dev/null +++ b/templates/confirmation/index.php @@ -0,0 +1,20 @@ + +

{TXT_PENDING}

+

{TXT_SHIPMENT}

+

{TXT_THANK_U_ORDER}

+ \ No newline at end of file diff --git a/templates/confirmation/success.htm b/templates/confirmation/success.htm new file mode 100644 index 0000000..83904ef --- /dev/null +++ b/templates/confirmation/success.htm @@ -0,0 +1,6 @@ + +
+

{TXT_SUCCESS}

+

{TXT_SHIPMENT}

+

{TXT_THANK_U_ORDER}

+
\ No newline at end of file diff --git a/templates/form/error.htm b/templates/form/error.htm new file mode 100644 index 0000000..ff1ef32 --- /dev/null +++ b/templates/form/error.htm @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/templates/form/form.htm b/templates/form/form.htm new file mode 100644 index 0000000..a2087e6 --- /dev/null +++ b/templates/form/form.htm @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 {TXT_SKU}{TXT_NAME}{TXT_QUANTITY}{TXT_PRICE}
+ {SETTING_SHOP_CURRENCY}   
{TXT_SHIPPING}
+ {SETTING_SHOP_CURRENCY}   
{TXT_SUM}
+ {SETTING_SHOP_CURRENCY}   

+
+

{FORM_ERROR}

+
{TXT_CUST_COUNTRY} + +
{LABEL}
+

+ +

+
+

+ +

+

+ +

+
+

{TXT_FILL_IN_SHIP_ADDRESS}:

+
{TXT_CUST_COUNTRY} + +
{LABEL}
+

+ +

+

+ +

+
+

+ +

+
+ + \ No newline at end of file diff --git a/templates/form/index.php b/templates/form/index.php new file mode 100644 index 0000000..3a6074a --- /dev/null +++ b/templates/form/index.php @@ -0,0 +1,20 @@ + + {TXT_SUBMIT_ORDER}: {TXT_ADDRESS} + {TXT_SUBMIT_ORDER}: {TXT_ADDRESS} + +

{TXT_FILL_IN_ADDRESS}:

+
+ diff --git a/templates/index.php b/templates/index.php new file mode 100644 index 0000000..75b5c09 --- /dev/null +++ b/templates/index.php @@ -0,0 +1,20 @@ + + + + + + + + + \ No newline at end of file diff --git a/templates/invoice/table_footer.htm b/templates/invoice/table_footer.htm new file mode 100644 index 0000000..1fdcd75 --- /dev/null +++ b/templates/invoice/table_footer.htm @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
{SKU}{NAME}
{ATTRIBUTE}
{QUANTITY}{PRICE}{SHIPPING}{ITEM_TAX_RATE}{TOTAL}

{TXT_SUBTOTAL}{SETTING_SHOP_CURRENCY} {ORDER_SUBTOTAL}
{TXT_SHIPPING_COST}{SETTING_SHOP_CURRENCY} {SHIPPING}
{TXT_INCL} {TAX_RATE} {TXT_TAX}{SETTING_SHOP_CURRENCY} {SALES_TAX}

{TXT_TOTAL}{SETTING_SHOP_CURRENCY} {ORDER_TOTAL}

\ No newline at end of file diff --git a/templates/invoice/table_header.htm b/templates/invoice/table_header.htm new file mode 100644 index 0000000..d35b900 --- /dev/null +++ b/templates/invoice/table_header.htm @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/mini_cart/empty.htm b/templates/mini_cart/empty.htm new file mode 100644 index 0000000..05c67af --- /dev/null +++ b/templates/mini_cart/empty.htm @@ -0,0 +1,14 @@ + + + + + + +
+

{TXT_CART}

+

{ERR_CART_EMPTY}

+
\ No newline at end of file diff --git a/templates/mini_cart/index.php b/templates/mini_cart/index.php new file mode 100644 index 0000000..3a6074a --- /dev/null +++ b/templates/mini_cart/index.php @@ -0,0 +1,20 @@ + + + + + +
+

{TXT_CART}

+

{TXT_ORDER_ID}: {ORDER_ID}

+

+ {QUANTITY_SUM} {TXT_ITEMS} +
+ {TXT_SUM}: {SHOP_CURRENCY} {TOTAL} +
+ ({TXT_EXCL_SHIPPING}) +

+ {TXT_VIEW_CART} +
\ No newline at end of file diff --git a/templates/pay_methods/error.htm b/templates/pay_methods/error.htm new file mode 100644 index 0000000..f6388d3 --- /dev/null +++ b/templates/pay_methods/error.htm @@ -0,0 +1,2 @@ + +

{ERR_NO_PAYMENT_METHOD}

\ No newline at end of file diff --git a/templates/pay_methods/footer.htm b/templates/pay_methods/footer.htm new file mode 100644 index 0000000..007e96a --- /dev/null +++ b/templates/pay_methods/footer.htm @@ -0,0 +1,3 @@ + +
{TXT_SKU}{TXT_NAME}{TXT_QUANTITY}{TXT_PRICE}
+ {SETTING_SHOP_CURRENCY}   
{TXT_SHIPPING}
+ {SETTING_SHOP_CURRENCY}   
{TXT_TAX}
+ %  
{TXT_SUM}
+ {SETTING_SHOP_CURRENCY}   

+
\ No newline at end of file diff --git a/templates/pay_methods/index.php b/templates/pay_methods/index.php new file mode 100644 index 0000000..3a6074a --- /dev/null +++ b/templates/pay_methods/index.php @@ -0,0 +1,20 @@ + + {TXT_TAC_AND_PAY_METHOD} + {TXT_TAC_AND_PAY_METHOD} + + + +
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/summary/address.htm b/templates/summary/address.htm new file mode 100644 index 0000000..841c235 --- /dev/null +++ b/templates/summary/address.htm @@ -0,0 +1,30 @@ + +

+ {TXT_ORDER_SUMMARY} + {TXT_ORDER_SUMMARY} +

+

{TXT_ORDER_ID}: {ORDER_ID}

+
+
+
+ + {TAC_LINK} +
+
+

{TXT_ENTER_CUST_MSG}:

+ +
+
+

{TXT_PAY_METHOD}:

+
+ + + + + + + + + + + + + + + + + + +
 {TXT_ADDRESS}{CUST_ADDRESS} {TXT_SHIP_ADDRESS}{SHIP_ADDRESS}
 {TXT_CUST_TAX_NO}{CUST_TAX_NO} 
  + + + +
\ No newline at end of file diff --git a/templates/summary/err_agree_tac.htm b/templates/summary/err_agree_tac.htm new file mode 100644 index 0000000..3592814 --- /dev/null +++ b/templates/summary/err_agree_tac.htm @@ -0,0 +1,12 @@ + +

{ERR_AGREE}

+
+

+    + {TXT_AGREE} {SETTING_SHOP_NAME}" +

+

+ +

+
+ \ No newline at end of file diff --git a/templates/summary/err_empty_cart.htm b/templates/summary/err_empty_cart.htm new file mode 100644 index 0000000..0a20cdf --- /dev/null +++ b/templates/summary/err_empty_cart.htm @@ -0,0 +1,7 @@ + +
+

{ERR_CART_EMPTY}

+
+

+
+
\ No newline at end of file diff --git a/templates/summary/free_shipping.htm b/templates/summary/free_shipping.htm new file mode 100644 index 0000000..c02f098 --- /dev/null +++ b/templates/summary/free_shipping.htm @@ -0,0 +1,4 @@ + +
+

{TXT_FREE_SHIPPING} {TXT_OVER} {SETTING_SHOP_CURRENCY} {SETTING_FREE_SHIPPING}

+
\ No newline at end of file diff --git a/templates/summary/index.php b/templates/summary/index.php new file mode 100644 index 0000000..3a6074a --- /dev/null +++ b/templates/summary/index.php @@ -0,0 +1,20 @@ + +
+
+

{TXT_SELECTED_PAY_METHOD}: {PAY_METHOD} +

+
+
+ \ No newline at end of file diff --git a/templates/summary/table_body.htm b/templates/summary/table_body.htm new file mode 100644 index 0000000..2efd622 --- /dev/null +++ b/templates/summary/table_body.htm @@ -0,0 +1,12 @@ + + + {SKU} + + {NAME}
{ATTRIBUTE}
+ {DESCRIPTION} + + {QUANTITY} + {PRICE} + {SHIPPING} + {TOTAL} + \ No newline at end of file diff --git a/templates/summary/table_footer.htm b/templates/summary/table_footer.htm new file mode 100644 index 0000000..bc98b75 --- /dev/null +++ b/templates/summary/table_footer.htm @@ -0,0 +1,51 @@ + + +
+ + + {TXT_SUBTOTAL} + {SETTING_SHOP_CURRENCY} {ORDER_SUBTOTAL} + + + {TXT_SHIPPING_COST} + {SETTING_SHOP_CURRENCY} {SHIPPING} + + + {TXT_INCL} {TAX_RATE} {TXT_TAX} + {SETTING_SHOP_CURRENCY} {SALES_TAX} + + +
+ + + {TXT_TOTAL} + {SETTING_SHOP_CURRENCY} {ORDER_TOTAL} + +
+ + + +
+ + {PAY_GATEWAY_DATA} +
+ + + +
+ + + +
+ +     + +
+ + + +
+ + + \ No newline at end of file diff --git a/templates/summary/table_header.htm b/templates/summary/table_header.htm new file mode 100644 index 0000000..d573d11 --- /dev/null +++ b/templates/summary/table_header.htm @@ -0,0 +1,17 @@ + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/uninstall.php b/uninstall.php new file mode 100644 index 0000000..f0f833a --- /dev/null +++ b/uninstall.php @@ -0,0 +1,55 @@ +query("SELECT pages_directory FROM ".TABLE_PREFIX."mod_bakery_general_settings"); +$general_settings = $query_general_settings->fetchRow(); +$module_pages_directory = '/'.$general_settings['pages_directory']; + +// Delete +$database->query("DELETE FROM ".TABLE_PREFIX."search WHERE name = 'module' AND value = 'bakery'"); +$database->query("DELETE FROM ".TABLE_PREFIX."search WHERE extra = 'bakery'"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_items"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_images"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_options"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_attributes"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_item_attributes"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_customer"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_order"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_general_settings"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_page_settings"); +$database->query("DROP TABLE ".TABLE_PREFIX."mod_bakery_payment_methods"); + +// Include WB functions file +require_once(WB_PATH.'/framework/functions.php'); + +$directory = WB_PATH.PAGES_DIRECTORY.$module_pages_directory; +if (is_dir($directory)) { + rm_full_dir($directory); +} + +$directory = WB_PATH.MEDIA_DIRECTORY.'/bakery'; +if (is_dir($directory)) { + rm_full_dir($directory); +} diff --git a/upgrade.php b/upgrade.php new file mode 100644 index 0000000..cdc6608 --- /dev/null +++ b/upgrade.php @@ -0,0 +1,1594 @@ + +.good { + color: green; +} +.bad { + color: red; +} +.ok { + color: blue; +} +.warn { + color: yellow; +} + +'; + + + + +// **************************************** +// BAKERY UPGRADE STARTING FROM VERSION 0.7 +// **************************************** + +// Get new modul version from modul info file +$info_file = WB_PATH.'/modules/bakery/info.php'; +if (file_exists($info_file)) { + include($info_file); +} +$new_module_version = $module_version; + +// Get old modul version from db +$sql = "SELECT `version` FROM `".TABLE_PREFIX."addons` WHERE `directory` = 'bakery'"; +$module_version = $database->get_one($sql); + + +// Version to be installed is the same or older than currently installed version +if ($module_version >= $new_module_version) { + echo ''; + $admin->print_error($MESSAGE['GENERIC_ALREADY_INSTALLED']); + echo '
'; + return; +} + + + + +// UPGRADE TO VERSION 0.7 +// ********************** + +if ($module_version < 0.7) { + + // Titel: Upgrading to + echo'

Upgrading to version 0.7:

'; + + // Get ITEMS table to see what needs to be created + $itemstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_items`"); + $items = $itemstable->fetchRow(); + + + // Adding new fields to the existing ITEMS table + echo'Adding new fields to the items table
'; + + if (!array_key_exists('option_attributes', $items)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` ADD `option_attributes` TEXT NOT NULL AFTER `shipping`")) { + echo 'Database field option_attributes added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field option_attributes exists, update not needed
'; } + + + if (!array_key_exists('option_name', $items)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` ADD `option_name` VARCHAR(255) NOT NULL DEFAULT '' AFTER `shipping`")) { + echo 'Database field option_name added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field option_name exists, update not needed
'; } + + + + + // Get CUSTOMER table to see what needs to be created + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + $num_customers = $customertable->numRows(); + if ($num_customers == 0) { + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_customer (order_id) VALUES ('0')"); + } + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + $customer = $customertable->fetchRow(); + + + // Modifying fields or adding new fields to the existing CUSTOMER table + echo'Modifying fields and adding new fields to the customer table
'; + + if (array_key_exists('cust_name', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` CHANGE `cust_name` `cust_first_name` VARCHAR(50)")) { + echo 'Changed database field cust_name to cust_first_name successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field cust_last_name exists, update not needed
'; } + + + if (!array_key_exists('cust_last_name', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `cust_last_name` VARCHAR(50) AFTER `cust_first_name`")) { + echo 'Database field cust_last_name added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field cust_last_name exists, update not needed
'; } + + + + + // Get ORDER table to see what needs to be created + $ordertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_order`"); + $num_orders = $ordertable->numRows(); + if ($num_orders == 0) { + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_order (order_id) VALUES ('0')"); + } + $ordertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_order`"); + $order = $ordertable->fetchRow(); + + + // Adding new field to the existing ORDER table + echo'Adding new field to the order table
'; + + if (!array_key_exists('attribute', $order)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_order` ADD `attribute` VARCHAR(50) NOT NULL AFTER `item_id`")) { + echo 'Database field attribute added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field attribute exists, update not needed
'; } + + + + + // Get SETTINGS table to see what needs to be created + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_settings`"); + if ($settings = $settingstable->fetchRow()) { + + // Adding new fields to the existing SETTINGS table + echo'Adding new fields to the settings table
'; + + if (!array_key_exists('offline_text', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_settings` ADD `offline_text` TINYTEXT NOT NULL AFTER `page_id`")) { + echo 'Database field offline_text added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field offline_text exists, update not needed
'; } + + + if (!array_key_exists('page_offline', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_settings` ADD `page_offline` ENUM('yes','no') NOT NULL DEFAULT 'no' AFTER `page_id`")) { + echo 'Database field page_offline added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field page_offline exists, update not needed
'; } + + + if (array_key_exists('shop_url', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_settings` CHANGE `shop_url` `proceed_url` VARCHAR(255) NOT NULL")) { + echo 'Changed database field shop_url to proceed_url successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field proceed_url exists, update not needed
'; } + + + if (array_key_exists('paypal_return', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_settings` DROP `paypal_return`")) { + echo 'Database field paypal_return deleted successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field paypal_return does not exist, update not needed
'; } + + + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_settings` CHANGE `shipping_method` `shipping_method` VARCHAR(20) NOT NULL")) { + echo 'Database field shipping_method changed successfully
'; + } else { echo ''.$database->get_error().'
'; } + + + if (!array_key_exists('free_shipping_msg', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_settings` ADD `free_shipping_msg` ENUM('show','hide') NOT NULL DEFAULT 'hide' AFTER `shipping_method`")) { + echo 'Database field free_shipping_msg added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field free_shipping_msg exists, update not needed
'; } + + + if (!array_key_exists('free_shipping', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_settings` ADD `free_shipping` DECIMAL(6,2) NOT NULL AFTER `shipping_method`")) { + echo 'Database field free_shipping added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field free_shipping exists, update not needed
'; } + + } else { + echo 'Database settings table does not exist, update not needed
'; + } + + echo"
"; + + + + + // Separat settings table into a general settings table and page settings table + + // Add new general settings table to the database + echo'Adding new general settings table to the database
'; + + // Create new GENERAL SETTINGS table + $mod_bakery = 'CREATE TABLE `'.TABLE_PREFIX.'mod_bakery_general_settings` ( ' + . '`shop_id` INT NOT NULL DEFAULT \'0\',' + . '`shop_name` VARCHAR(100) NOT NULL ,' + . '`use_captcha` ENUM(\'yes\',\'no\') NOT NULL ,' + . '`tac_url` VARCHAR(255) NOT NULL ,' + . '`shop_email` VARCHAR(50) NOT NULL ,' + . '`shop_country` VARCHAR(2) NOT NULL ,' + . '`shop_currency` VARCHAR(3) NOT NULL ,' + . '`bank_account` TEXT NOT NULL ,' + . '`paypal_email` VARCHAR(50) NOT NULL ,' + . '`paypal_page` VARCHAR(255) NOT NULL ,' + . '`payment_method` VARCHAR(20) NOT NULL ,' + . '`tax_rate` DECIMAL(5,3) NOT NULL ,' + . '`tax_included` ENUM(\'included\',\'excluded\') NOT NULL ,' + . '`shipping_domestic` DECIMAL(6,2) NOT NULL ,' + . '`shipping_abroad` DECIMAL(6,2) NOT NULL ,' + . '`shipping_method` VARCHAR(20) NOT NULL ,' + . '`free_shipping` DECIMAL(6,2) NOT NULL ,' + . '`free_shipping_msg` ENUM(\'show\',\'hide\') NOT NULL ,' + . '`email_subject_advance` TEXT NOT NULL ,' + . '`email_pay_advance` TEXT NOT NULL ,' + . '`email_subject_paypal` TEXT NOT NULL ,' + . '`email_paypal` TEXT NOT NULL ,' + . 'PRIMARY KEY (shop_id)' + . ' )'; + if ($database->query($mod_bakery)) { + echo 'Created new general_settings table successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + // Get "old" settings to insert them into the new general_settings table + if ($settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_settings` ORDER BY section_id DESC LIMIT 1")) { + $settings = $settingstable->fetchRow(); + if ($settings['section_id'] == '') { + echo 'No old settings in database to insert into general_settings table
'; + } + else { + echo 'Got old settings from database section_id='.$settings['section_id'].' successfully
'; + } + } + else { + echo ''.$database->get_error().'
'; + } + + // Set default general_settings + $shop_id = 0; + $shop_name = $settings['shop_name']; + $use_captcha = $settings['use_captcha']; + $tac_url = $settings['tac_url']; + $shop_email = $settings['shop_email']; + $shop_country = $settings['shop_country']; + $shop_currency = $settings['shop_currency']; + $bank_account = $settings['bank_account']; + $paypal_email = $settings['paypal_email']; + $paypal_page = $settings['paypal_page']; + $payment_method = "all"; + $tax_rate = $settings['tax_rate']; + $tax_included = $settings['tax_included']; + $shipping_domestic = $settings['shipping_domestic']; + $shipping_abroad = $settings['shipping_abroad']; + if ($settings['shipping_method'] == '') {$shipping_method = "flat"; } else {$shipping_method = $settings['shipping_method']; } + if ($settings['free_shipping'] == '') {$settings['free_shipping'] = 0; } else {$free_shipping = $settings['free_shipping']; } + if ($settings['free_shipping_msg'] == '') {$settings['free_shipping_msg'] = "all"; } else {$free_shipping_msg = $settings['free_shipping_msg']; } + $email_subject_advance = $settings['email_subject_advance']; + $email_pay_advance = $settings['email_pay_advance']; + $email_subject_paypal = $settings['email_subject_paypal']; + $email_paypal = $settings['email_paypal']; + + // Insert values into general_settings table + if ($database->query("INSERT INTO ".TABLE_PREFIX."mod_bakery_general_settings (shop_id, shop_name, use_captcha, tac_url, shop_email, shop_country, shop_currency, bank_account, paypal_email, paypal_page, payment_method, tax_rate, tax_included, shipping_domestic, shipping_abroad, shipping_method, free_shipping, free_shipping_msg, email_subject_advance, email_pay_advance, email_subject_paypal, email_paypal) + VALUES ('$shop_id', '$shop_name', '$use_captcha', '$tac_url', '$shop_email', '$shop_country', '$shop_currency', '$bank_account', '$paypal_email', '$paypal_page', '$payment_method', '$tax_rate', '$tax_included', '$shipping_domestic', '$shipping_abroad', '$shipping_method', '$free_shipping', '$free_shipping_msg', '$email_subject_advance', '$email_pay_advance', '$email_subject_paypal', '$email_paypal')")) { + echo 'Added default settings into general_settings table successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + + + + // Insert default settings + + // Set default page_settings + if ($settings['page_offline'] == '') { $page_offline = "no"; } else {$page_offline = $settings['page_offline']; } + if ($settings['offline_text'] == '') { + if (LANGUAGE_LOADED) { + include(WB_PATH.'/modules/bakery/languages/EN.php'); + if (file_exists(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php')) { + include(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php'); + } + } + $offline_text = $MOD_BAKERY['ERR_OFFLINE_TEXT']; + } + else { + $offline_text = $settings['offline_text']; + } + + // Adding default settings to the new fields + $query_dates = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_settings WHERE section_id != 0 and page_id != 0"); + while ($result = $query_dates->fetchRow()) { + + echo '
Adding default settings to database for bakery section_id='.$result['section_id'].'
'; + $section_id = $result['section_id']; + + if ($database->query("UPDATE `".TABLE_PREFIX."mod_bakery_settings` SET `page_offline` = '$page_offline' WHERE `section_id` = $section_id")) { + echo 'Database data page_offline added successfully
'; + } + echo ''.$database->get_error().'
'; + + + if ($database->query("UPDATE `".TABLE_PREFIX."mod_bakery_settings` SET `offline_text` = '$offline_text' WHERE `section_id` = $section_id")) { + echo 'Database data offline_text added successfully
'; + } + echo ''.$database->get_error().'
'; + } + + echo"
"; + + + + + // Rename settings table to page_settings table + echo'Renaming settings table to page_settings table
'; + + if ($database->query("RENAME TABLE `".TABLE_PREFIX."mod_bakery_settings` TO `".TABLE_PREFIX."mod_bakery_page_settings`")) { + echo 'Renamed settings table to page_settings table successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + // Delete all fields which have been moved to general_settings table + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_page_settings` DROP `shop_name`, DROP `tac_url`, DROP `use_captcha`, DROP `shop_email`, DROP `shop_country`, DROP `shop_currency`, DROP `bank_account`, DROP `paypal_email`, DROP `paypal_page`, DROP `tax_rate`, DROP `tax_included`, DROP `shipping_domestic`, DROP `shipping_abroad`, DROP `shipping_method`, DROP `free_shipping`, DROP `free_shipping_msg`, DROP `email_subject_advance`, DROP `email_pay_advance`, DROP `email_subject_paypal`, DROP `email_paypal`")) { + echo 'Deleted all fields of page_settings (which have been created newly in the general_settings table) successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } +} + + + + +// UPGRADE TO VERSION 0.8 +// ********************** + +if ($module_version < 0.8) { + + // Titel: Upgrading to + echo'

Upgrading to version 0.8:

'; + + // Get ITEMS table to see what needs to be created + $itemstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_items`"); + $items = $itemstable->fetchRow(); + + + // Adding new fields to the existing ITEMS table + echo'Adding new field to the items table
'; + + if (!array_key_exists('tax_rate', $items)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` ADD `tax_rate` DECIMAL(5,3) NOT NULL AFTER `shipping`")) { + echo 'Database field tax_rate added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field tax_rate exists, update not needed
'; } + + + + // Get CUSTOMER table to see what needs to be created + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + $num_customers = $customertable->numRows(); + if ($num_customers == 0) { + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_customer (order_id) VALUES ('0')"); + } + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + $customer = $customertable->fetchRow(); + + + // Modifying fields or adding new fields to the existing CUSTOMER table + echo'Adding new fields to the customer table
'; + + if (!array_key_exists('user_id', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `user_id` INT(6) NOT NULL AFTER `submitted`")) { + echo 'Database field user_id added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field user_id exists, update not needed
'; } + + + if (!array_key_exists('cust_state', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `cust_state` VARCHAR(50) NOT NULL AFTER `cust_city`")) { + echo 'Database field cust_state added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field cust_state exists, update not needed
'; } + + + + // Get ORDER table to see what needs to be created + $ordertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_order`"); + $num_orders = $ordertable->numRows(); + if ($num_orders == 0) { + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_order (order_id) VALUES ('0')"); + } + $ordertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_order`"); + $order = $ordertable->fetchRow(); + + + // Adding new field to the existing ORDER table + echo'Adding new field to the order table
'; + + if (!array_key_exists('tax_rate', $order)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_order` ADD `tax_rate` DECIMAL(5,3) NOT NULL AFTER `price`")) { + echo 'Database field attribute added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field tax_rate exists, update not needed
'; } + + + + + // Get GENERAL SETTINGS table to see what needs to be created + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + $settings = $settingstable->fetchRow(); + + // Adding new fields to the existing SETTINGS table + echo'Adding new fields to the general_settings table
'; + + if (!array_key_exists('zip_location', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `zip_location` ENUM('inside','end') NOT NULL DEFAULT 'inside' AFTER `shop_country`")) { + echo 'Database field zip_location added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field zip_location exists, update not needed
'; } + + + if (!array_key_exists('state_field', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `state_field` ENUM('show','hide') NOT NULL DEFAULT 'hide' AFTER `shop_country`")) { + echo 'Database field state_field added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field state_field exists, update not needed
'; } + + + if (!array_key_exists('tax_rate2', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `tax_rate2` DECIMAL(5,3) NOT NULL AFTER `tax_rate`")) { + echo 'Database field tax_rate2 added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field tax_rate2 exists, update not needed
'; } + + + if (!array_key_exists('tax_rate1', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `tax_rate1` DECIMAL(5,3) NOT NULL AFTER `tax_rate`")) { + echo 'Database field tax_rate1 added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field tax_rate1 exists, update not needed
'; } + + + if (!array_key_exists('zone_countries', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `zone_countries` TEXT NOT NULL AFTER `shipping_abroad`")) { + echo 'Database field zone_countries added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field zone_countries exists, update not needed
'; } + + + if (!array_key_exists('shipping_zone', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `shipping_zone` DECIMAL(6,2) NOT NULL AFTER `shipping_abroad`")) { + echo 'Database field shipping_zone added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field shipping_zone exists, update not needed
'; } + + echo"
"; + + + // Insert default settings into items table + + // Get "old" settings + if ($settingstable = $database->query("SELECT tax_rate FROM `".TABLE_PREFIX."mod_bakery_general_settings`")) { + $settings = $settingstable->fetchRow(); + if ($settings['tax_rate'] == '') { + echo 'No old tax_rate setting in database to insert into items table
'; + } + else { + echo 'Got old tax_rate setting ('.$settings['tax_rate'].'%) from database to insert into items table
'; + } + } + else { + echo ''.$database->get_error().'
'; + } + + // Insert values into general_settings table + if ($database->query("UPDATE `".TABLE_PREFIX."mod_bakery_items` SET `tax_rate` = '$tax_rate'")) { + echo 'Added default tax_rate setting into items table successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } +} + + + + +// UPGRADE TO VERSION 0.8.1 +// ************************ + +if ($module_version < 0.81) { + + // Titel: Upgrading to + echo'

Upgrading to version 0.8.1:

'; + + // Get SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_page_settings`"); + if ($settings = $settingstable->fetchRow()) { + + if (array_key_exists('proceed_url', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_page_settings` CHANGE `proceed_url` `continue_url` VARCHAR(255) NOT NULL")) { + echo 'Changed database field proceed_url to continue_url successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field continue_url exists, update not needed
'; } + + } +} + + + + +// UPGRADE TO VERSION 0.8.3 +// ************************ + +if ($module_version < 0.83) { + + // Titel: Upgrading to + echo'

Upgrading to version 0.8.3:

'; + + // Get SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + if ($settings = $settingstable->fetchRow()) { + + if (!array_key_exists('tax_rate_shipping', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `tax_rate_shipping` DECIMAL(5,3) NOT NULL AFTER `tax_included`")) { + echo 'Database field tax_rate_shipping added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field tax_rate_shipping exists, update not needed
'; } + + } +} + + + + +// UPGRADE TO VERSION 0.9 +// ************************ + +if ($module_version < 0.9) { + + // Titel: Upgrading to + echo'

Upgrading to version 0.9:

'; + + + + // Add new options table to the database + echo'Adding new options table to the database
'; + + // Create new OPTIONS table + $mod_bakery = 'CREATE TABLE `'.TABLE_PREFIX.'mod_bakery_options` ( ' + . ' `option_id` INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY, ' + . ' `option_name` VARCHAR(50) NOT NULL' + . ' )'; + if ($database->query($mod_bakery)) { + echo 'Created new options table successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + + // Add new attributes table to the database + echo'Adding new attributes table to the database
'; + + // Create new ATTRIBUTES table + $mod_bakery = 'CREATE TABLE `'.TABLE_PREFIX.'mod_bakery_attributes` ( ' + . ' `attribute_id` INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY, ' + . ' `option_id` INT(6) NOT NULL, ' + . ' `attribute_name` VARCHAR(50) NOT NULL' + . ' )'; + if ($database->query($mod_bakery)) { + echo 'Created new attributes table successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + + // Add new items attributes table to the database + echo'Adding new item attributes table to the database
'; + + // Create new ITEMS ATTRIBUTES table + $mod_bakery = 'CREATE TABLE `'.TABLE_PREFIX.'mod_bakery_item_attributes` ( ' + . ' `assign_id` INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY, ' + . ' `item_id` INT(6) NOT NULL, ' + . ' `option_id` INT(6) NOT NULL, ' + . ' `attribute_id` INT(6) NOT NULL, ' + . ' `price` DECIMAL(9,2) NOT NULL, ' + . ' `operator` VARCHAR(1) NOT NULL' + . ' )'; + if ($database->query($mod_bakery)) { + echo 'Created new item attributes table successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + + + // There has to be at least one row in the ITEMS table - if not, insert blank row + $itemstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_items`"); + $num_items = $itemstable->numRows(); + if ($num_items == 0) { + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_items (item_id) VALUES ('0')"); + } + + // Get ITEMS table to see what needs to be added + $itemstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_items`"); + if ($item = $itemstable->fetchRow()) { + + if (!array_key_exists('stock', $item)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` ADD `stock` VARCHAR(20) NOT NULL DEFAULT '' AFTER `sku`")) { + echo 'Database field stock added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field stock exists, update not needed
'; } + } + + + // There has to be at least one row in the CUSTOMER table - if not, insert blank row + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + $num_customers = $customertable->numRows(); + if ($num_customers == 0) { + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_customer (order_id) VALUES ('0')"); + } + + // Get CUSTOMER table to see what needs to be changed + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + if ($customer = $customertable->fetchRow()) { + + if (array_key_exists('submitted', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` CHANGE `submitted` `submitted` VARCHAR(3) NOT NULL")) { + echo 'Changed database field submitted to type VARCHAR(3) successfully
'; + } else { echo ''.$database->get_error().'
'; } + } + + if (!array_key_exists('status', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `status` VARCHAR(20) NOT NULL DEFAULT 'none' AFTER `submitted`")) { + echo 'Database field status added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field status exists, update not needed
'; } + + if (!array_key_exists('invoice', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `invoice` TEXT NOT NULL AFTER `cust_phone`")) { + echo 'Database field invoice added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field invoice exists, update not needed
'; } + + if (!array_key_exists('ship_zip', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `ship_zip` VARCHAR(10) NOT NULL AFTER `cust_phone`")) { + echo 'Database field ship_zip added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field ship_zip exists, update not needed
'; } + + if (!array_key_exists('ship_country', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `ship_country` VARCHAR(2) NOT NULL AFTER `cust_phone`")) { + echo 'Database field ship_country added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field ship_country exists, update not needed
'; } + + if (!array_key_exists('ship_state', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `ship_state` VARCHAR(50) NOT NULL AFTER `cust_phone`")) { + echo 'Database field ship_state added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field ship_state exists, update not needed
'; } + + if (!array_key_exists('ship_city', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `ship_city` VARCHAR(50) NOT NULL AFTER `cust_phone`")) { + echo 'Database field ship_city added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field ship_city exists, update not needed
'; } + + if (!array_key_exists('ship_street', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `ship_street` VARCHAR(50) NOT NULL AFTER `cust_phone`")) { + echo 'Database field ship_street added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field ship_street exists, update not needed
'; } + + if (!array_key_exists('ship_last_name', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `ship_last_name` VARCHAR(50) NOT NULL AFTER `cust_phone`")) { + echo 'Database field ship_last_name added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field ship_last_name exists, update not needed
'; } + + if (!array_key_exists('ship_first_name', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `ship_first_name` VARCHAR(50) NOT NULL AFTER `cust_phone`")) { + echo 'Database field ship_first_name added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field ship_first_name exists, update not needed
'; } + + } + + + // There has to be at least one row in the ORDER table - if not, insert blank row + $ordertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_order`"); + $num_order = $ordertable->numRows(); + if ($num_order == 0) { + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_order (order_id) VALUES ('0')"); + } + + // Get ORDER table to see what needs to be added + $ordertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_order`"); + if ($order = $ordertable->fetchRow()) { + + if (array_key_exists('attribute', $order)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_order` CHANGE `attribute` `attributes` VARCHAR(50) NOT NULL")) { + echo 'Changed database field attribute to attributes successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + if ($database->query("UPDATE `".TABLE_PREFIX."mod_bakery_order` SET `attributes` = ''")) { + echo 'Deleted outdated order attributes successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + } + } + + + // Get GENERAL SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + if ($settings = $settingstable->fetchRow()) { + + if (!array_key_exists('shipping_form', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `shipping_form` VARCHAR(10) NOT NULL AFTER `shop_country`")) { + echo 'Database field shipping_form added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field shipping_form exists, update not needed
'; } + + if (!array_key_exists('invoice', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `invoice` TEXT NOT NULL AFTER `email_paypal`")) { + echo 'Database field invoice added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field invoice exists, update not needed
'; } + + if (!array_key_exists('email_invoice', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `email_invoice` TEXT NOT NULL AFTER `email_paypal`")) { + echo 'Database field email_invoice added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field email_invoice exists, update not needed
'; } + + if (!array_key_exists('email_subject_invoice', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `email_subject_invoice` TEXT NOT NULL AFTER `email_paypal`")) { + echo 'Database field email_subject_invoice added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field email_subject_invoice exists, update not needed
'; } + + } + + + // Insert default settings into general settings table + if (LANGUAGE_LOADED) { + include(WB_PATH.'/modules/bakery/languages/EN.php'); + include(WB_PATH.'/modules/bakery/payment_methods/invoice/languages/EN.php'); + if (file_exists(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php')) { + include(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php'); + } + $payment_method = "invoice"; + if (file_exists(WB_PATH.'/modules/bakery/payment_methods/invoice/languages/'.LANGUAGE.'.php')) { + include(WB_PATH.'/modules/bakery/payment_methods/invoice/languages/'.LANGUAGE.'.php'); + } + } + + $email_subject_invoice = $MOD_BAKERY[$payment_method]['EMAIL_SUBJECT_CUSTOMER']; + $email_invoice = $MOD_BAKERY[$payment_method]['EMAIL_BODY_CUSTOMER']; + $invoice = $admin->add_slashes($MOD_BAKERY[$payment_method]['INVOICE_TEMPLATE']); + + if ($database->query("UPDATE `".TABLE_PREFIX."mod_bakery_general_settings` SET `email_subject_invoice` = '$email_subject_invoice', `email_invoice` = '$email_invoice', `invoice` = '$invoice'")) { + echo 'Added default general settings successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + + // General upgrade note + echo ' +
+

IMPORTANT UPGRADE NOTE UPGRADING TO v0.9

+
    +
  • Stylesheet: If you keep your current Bakery stylesheets, make sure you are changing the class names from mode_ to mod_ (mod without "e", eg. mod_bakery_anything_f).

  • +
  • Item options: Due to a new system handling the item options you lost all your item options. Use your database backup to restore the options and attributes to their former condition.
  • +
+
+'; +} + + + + +// UPGRADE TO VERSION 0.9.6 +// ************************ + +if ($module_version < 0.96) { + + // Titel: Upgrading to + echo'

Upgrading to version 0.9.6:

'; + + // Get SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + if ($settings = $settingstable->fetchRow()) { + + if (!array_key_exists('shop_state', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `shop_state` VARCHAR(2) NOT NULL AFTER `shop_country`")) { + echo 'Database field shop_state added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field shop_state exists, update not needed
'; } + + if (!array_key_exists('tax_by', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `tax_by` VARCHAR(10) NOT NULL AFTER `tax_included`")) { + echo 'Database field tax_by added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field tax_by exists, update not needed
'; } + + // Insert default settings into general settings table + if ($database->query("UPDATE `".TABLE_PREFIX."mod_bakery_general_settings` SET `tax_by` = 'country'")) { + echo 'Added default general settings successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + } +} + + + + +// UPGRADE TO VERSION 0.9.7 +// ************************ + +if ($module_version < 0.97) { + + // Titel: Upgrading to + echo'

Upgrading to version 0.9.7:

'; + + // Get SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + if ($settings = $settingstable->fetchRow()) { + + echo "Modifying table general_settings:
"; + + if (!array_key_exists('definable_field_0', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `definable_field_0` VARCHAR(50) NOT NULL AFTER `use_captcha`")) { + echo 'Database field definable_field_0 added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field definable_field_0 exists, update not needed
'; } + + if (!array_key_exists('definable_field_1', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `definable_field_1` VARCHAR(50) NOT NULL AFTER `definable_field_0`")) { + echo 'Database field definable_field_1 added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field definable_field_1 exists, update not needed
'; } + + if (!array_key_exists('definable_field_2', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `definable_field_2` VARCHAR(50) NOT NULL AFTER `definable_field_1`")) { + echo 'Database field definable_field_2 added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field definable_field_2 exists, update not needed
'; } + + if (!array_key_exists('stock_mode', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `stock_mode` VARCHAR(10) NOT NULL AFTER `definable_field_2`")) { + echo 'Database field stock_mode added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field stock_mode exists, update not needed
'; } + + if (!array_key_exists('stock_limit', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `stock_limit` INT(3) NOT NULL AFTER `stock_mode`")) { + echo 'Database field stock_limit added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field stock_limit exists, update not needed
'; } + } + + // Change continue_url to a link not containing domain name nor page directory + echo "
Modifying table page_settings:
"; + $settingstable = $database->query("SELECT section_id, continue_url FROM `".TABLE_PREFIX."mod_bakery_page_settings`"); + while ($settings = $settingstable->fetchRow()) { + $section_id = $settings['section_id']; + $continue_url = str_replace(array(WB_URL.PAGES_DIRECTORY, PAGE_EXTENSION), array('', ''), $settings['continue_url']); + if ($database->query("UPDATE ".TABLE_PREFIX."mod_bakery_page_settings SET continue_url = '$continue_url' WHERE section_id = '$section_id'")) { + echo 'Changed continue_url of section_id='.$section_id.' successfully to a link not containing domain name nor page directory
'; + } else { + echo ''.$database->get_error().'
'; + } + } + + // Get ITEMS table to see what needs to be added + echo "
Modifying table items:
"; + $itemstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_items`"); + if ($item = $itemstable->fetchRow()) { + + if (!array_key_exists('definable_field_0', $item)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` ADD `definable_field_0` VARCHAR(150) NOT NULL AFTER `tax_rate`")) { + echo 'Database field definable_field_0 added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field definable_field_0 exists, update not needed
'; } + + if (!array_key_exists('definable_field_1', $item)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` ADD `definable_field_1` VARCHAR(150) NOT NULL AFTER `definable_field_0`")) { + echo 'Database field definable_field_1 added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field definable_field_1 exists, update not needed
'; } + + if (!array_key_exists('definable_field_2', $item)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` ADD `definable_field_2` VARCHAR(150) NOT NULL AFTER `definable_field_1`")) { + echo 'Database field definable_field_2 added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field definable_field_2 exists, update not needed
'; } + + } + + // Change item link to a link not containing domain name nor page directory + while ($item = $itemstable->fetchRow()) { + $item_id = $item['item_id']; + $link = str_replace(PAGES_DIRECTORY, '', $item['link']); + if ($database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET link = '$link' WHERE item_id = '$item_id'")) { + echo 'Changed item link of item_id='.$item_id.' successfully to a link not containing domain name nor page directory
'; + } else { + echo ''.$database->get_error().'
'; + } + } + +} + + + + +// UPGRADE TO VERSION 1.1 +// ********************** + +if ($module_version < 1.1) { + + // Titel: Upgrading to + echo'

Upgrading to version 1.1:

'; + + + // Add new fields to the general settings table + echo'Adding new fields to the general_settings table
'; + + // Get SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + if ($settings = $settingstable->fetchRow()) { + + if (!array_key_exists('display_settings', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `display_settings` ENUM('1','0') NOT NULL DEFAULT '1' AFTER `zip_location`")) { + echo 'Database field display_settings added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field display_settings exists, update not needed
'; } + + + if (!array_key_exists('out_of_stock_orders', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `out_of_stock_orders` ENUM('1','0') NOT NULL DEFAULT '0' AFTER `stock_limit`")) { + echo 'Database field out_of_stock_orders added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field out_of_stock_orders exists, update not needed
'; } + + + if (!array_key_exists('thousands_sep', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `thousands_sep` VARCHAR(1) NOT NULL DEFAULT '\'' AFTER `shop_currency`")) { + echo 'Database field thousands_sep added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field thousands_sep exists, update not needed
'; } + + + if (!array_key_exists('dec_point', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `dec_point` VARCHAR(1) NOT NULL DEFAULT '.' AFTER `shop_currency`")) { + echo 'Database field dec_point added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field dec_point exists, update not needed
'; } + + + if (!array_key_exists('skip_checkout', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `skip_checkout` ENUM('1','0') NOT NULL DEFAULT '0' AFTER `tax_included`")) { + echo 'Database field skip_checkout added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field skip_checkout exists, update not needed
'; } + } + + + // Add new payment methods table to the database + echo'
Adding new payment methods table to the database
'; + + // Create new PAYMENT METHODS table + $mod_bakery = 'CREATE TABLE `'.TABLE_PREFIX.'mod_bakery_payment_methods` ( ' + . '`pm_id` INT(11) NOT NULL AUTO_INCREMENT ,' + . '`active` INT(1) NOT NULL ,' + . '`directory` VARCHAR(50) NOT NULL ,' + . '`name` VARCHAR(50) NOT NULL ,' + . '`version` VARCHAR(6) NOT NULL ,' + . '`author` VARCHAR(50) NOT NULL ,' + . '`requires` VARCHAR(6) NOT NULL ,' + . '`field_1` VARCHAR(150) NOT NULL ,' + . '`value_1` TEXT NOT NULL ,' + . '`field_2` VARCHAR(150) NOT NULL ,' + . '`value_2` TEXT NOT NULL ,' + . '`field_3` VARCHAR(150) NOT NULL ,' + . '`value_3` TEXT NOT NULL ,' + . '`field_4` VARCHAR(150) NOT NULL ,' + . '`value_4` TEXT NOT NULL ,' + . '`field_5` VARCHAR(150) NOT NULL ,' + . '`value_5` TEXT NOT NULL ,' + . '`field_6` VARCHAR(150) NOT NULL ,' + . '`value_6` TEXT NOT NULL ,' + . '`cust_email_subject` TEXT NOT NULL ,' + . '`cust_email_body` TEXT NOT NULL ,' + . '`shop_email_subject` TEXT NOT NULL ,' + . '`shop_email_body` TEXT NOT NULL ,' + . 'PRIMARY KEY (`pm_id`)' + . ' )'; + if ($database->query($mod_bakery)) { + echo 'Created new payment_methods table successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + + // Add all avaiable payment_methods to the db + echo'
Adding all avaiable payment_methods to the database
'; + + if (!file_exists(WB_PATH.'/modules/bakery/payment_methods/load.php')) { + echo 'File load.php is missing. Cannot create new database table payment_methods nor move the payment method settings. Please add your payment settings manually!
'; + } else { + // Include payment methods loading file + include(WB_PATH.'/modules/bakery/payment_methods/load.php'); + + // Get "old" general settings + if ($settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`")) { + $settings = $settingstable->fetchRow(); + extract($settings); + $moved_successfully = true; + + // Loop through the payment methods and overwrite default values that have been inserted by load.php + foreach ($load_payment_methods as $payment_method) { + switch ($payment_method) { + case 'advance': + if ($database->query("UPDATE ".TABLE_PREFIX."mod_bakery_payment_methods SET cust_email_subject = '$email_subject_advance', cust_email_body = '$email_pay_advance' WHERE `directory` = 'advance'")) { + echo 'Moved advance payment method settings to the payment_methods table successfully
'; + } else { + echo ''.$database->get_error().'
'; + $moved_successfully = false; + } + break; + case 'invoice': + if ($database->query("UPDATE ".TABLE_PREFIX."mod_bakery_payment_methods SET value_1 = '$bank_account', value_4 = '$invoice', cust_email_subject = '$email_subject_invoice', cust_email_body = '$email_invoice' WHERE `directory` = 'invoice'")) { + echo 'Moved invoice payment method settings to the payment_methods table successfully
'; + } else { + echo ''.$database->get_error().'
'; + $moved_successfully = false; + } + break; + case 'paypal': + if ($database->query("UPDATE ".TABLE_PREFIX."mod_bakery_payment_methods SET value_1 = '$paypal_email', value_2 = '$paypal_page', cust_email_subject = '$email_subject_paypal', cust_email_body = '$email_paypal' WHERE `directory` = 'paypal'")) { + echo 'Moved PayPal payment method settings to the payment_methods table successfully
'; + } else { + echo ''.$database->get_error().'
'; + $moved_successfully = false; + } + break; + } + } + } + } + + + // Delete all fields which have been moved to the payment_methods table + echo'
Deleting all fields which have been moved to the payment methods table
'; + + if ($moved_successfully) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` DROP `payment_method`, DROP `bank_account`, DROP `paypal_email`, DROP `paypal_page`, DROP `email_subject_advance`, DROP `email_pay_advance`, DROP `email_subject_paypal`, DROP `email_paypal`, DROP `email_subject_invoice`, DROP `email_invoice`, DROP `invoice`")) { + echo 'Deleted all fields of general_settings (that have been moved to the payment_methods table) successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + } else { + echo 'Did not drop general_settings fields since they have not been moved to the payment_methods table
'; + } + + + // Modifying fields or adding new fields to the existing CUSTOMER table + echo'Modifying fields and adding new fields to the customer table
'; + + // Get CUSTOMER table to see what needs to be created + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + $num_customers = $customertable->numRows(); + if ($num_customers == 0) { + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_customer (order_id) VALUES ('0')"); + } + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + $customer = $customertable->fetchRow(); + + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` CHANGE `submitted` `submitted` VARCHAR(20) NOT NULL DEFAULT 'no'")) { + echo 'Changed database field submitted to type VARCHAR(20) successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + if (!array_key_exists('transaction_status', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `transaction_status` VARCHAR(10) NOT NULL DEFAULT 'none' AFTER `submitted`")) { + echo 'Database field transaction_status added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field transaction_status exists, update not needed
'; } + + if (!array_key_exists('transaction_id', $customer)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `transaction_id` VARCHAR(50) NOT NULL DEFAULT 'none' AFTER `submitted`")) { + echo 'Database field transaction_id added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field transaction_id exists, update not needed
'; } + + + // Change payment method abbreviations + echo'
Changing all payment method abbreviations to full length words
'; + + // Change payment method abbreviations to full length words + $payment_methods = array("adv"=>"advance", "inv"=>"invoice", "pp"=>"paypal"); + foreach ($payment_methods as $abbr => $payment_method) { + if ($database->query("UPDATE `".TABLE_PREFIX."mod_bakery_customer` SET `submitted` = '$payment_method' WHERE `submitted` = '$abbr'")) { + echo 'Changed payment method abbreviation '.$abbr.' to full length word '.$payment_method.' successfully
'; + } else { + echo ''.$database->get_error().'
'; + } + } +} + + + + +// UPGRADE TO VERSION 1.3 +// ********************** + +if ($module_version < 1.3) { + + // Titel: Upgrading to + echo'

Upgrading to version 1.3:

'; + + // Get ITEMS table to see what needs to be created + $itemstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_items`"); + $items = $itemstable->fetchRow(); + + if (!array_key_exists('main_image', $items)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` CHANGE `extension` `main_image` VARCHAR(50) NOT NULL")) { + echo 'Changed database field extension to main_image successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field main_image exists, update not needed
'; } + + + // Get SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_page_settings`"); + if ($settings = $settingstable->fetchRow()) { + + if (!array_key_exists('lightbox2', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_page_settings` ADD `lightbox2` VARCHAR(10) NOT NULL DEFAULT 'detail' AFTER `resize`")) { + echo 'Database field lightbox2 added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field lightbox2 exists, update not needed
'; } + + if ($database->query("UPDATE `".TABLE_PREFIX."mod_bakery_page_settings` SET `resize` = '100' WHERE resize = 0")) { + echo 'Changed thumbnail resize to 100x100px successfully
'; + } else { + echo ''.$database->get_error().'
'; + } + } + + + // General upgrade note + echo ' +
+

IMPORTANT UPGRADE NOTE UPGRADING TO v1.3

+
    +
  • Item images: Due to a new way how Bakery handles and stores images you will have to reupload ALL item images using the Bakery backend. Use your backup of the /media/bakery directory. Use speaking image file names since they are used for the image <alt> and <title> tag and shown as the Lightbox2 caption.

  • +
  • Item templates: Use the vars [THUMB], [THUMBS], [IMAGE] and [IMAGES] to display images. Depending on your page settings the images will be linked automatically to the detail page or overlay on the current page using Lightbox2. So there is no more need to link the image in your template.
  • +
+
+'; +} + + + + +// UPGRADE TO VERSION 1.4.0 +// ************************ + +if ($module_version < 1.40) { + + // Titel: Upgrading to + echo'

Upgrading to version 1.4.0:

'; + + // Change PAYMENT METHODS table + if ($database->query("UPDATE `".TABLE_PREFIX."mod_bakery_payment_methods` SET `value_4` = `value_2`, `field_4` = `field_2`, `value_2` = '', `field_2` = '' WHERE `directory` = 'invoice' AND `version` = '0.1' LIMIT 1")) { + echo 'Changed database table payment methods successfully
'; + } + else { + echo ''.$database->get_error().'
'; + } + + + // Get GENERAL SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + if ($settings = $settingstable->fetchRow()) { + + if (!array_key_exists('skip_cart', $settings)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `skip_cart` ENUM('yes', 'no') NOT NULL DEFAULT 'no' AFTER `zip_location`")) { + echo 'Database field skip_cart added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field skip_cart exists, update not needed
'; } + } + + + // Convert continue_url from string link to numeric page_id + if ($database->query("UPDATE ".TABLE_PREFIX."mod_bakery_page_settings ps SET ps.continue_url = (SELECT p.page_id FROM ".TABLE_PREFIX."pages p WHERE ps.continue_url = p.link) WHERE LEFT(`continue_url`, 1) = '/'")) { + echo 'Converted continue_url from string link to numeric page_id successfully
'; + } else { + echo ''.$database->get_error().'
'; + } + + + // Replace all submit button names "cart" by new ones "view_cart" or "add_to_cart" at all page templates + $display_warning = false; + $replace_counter = 0; + $query_page_settings = $database->query("SELECT section_id, header, item_loop, footer, item_header, item_footer FROM ".TABLE_PREFIX."mod_bakery_page_settings"); + if ($query_page_settings->numRows() > 0) { + while ($page_settings = $query_page_settings->fetchRow()) { + $page_settings = array_map('stripslashes', $page_settings); + foreach ($page_settings as $template_name => $template_html) { + if ($template_name != 'section_id' && !is_numeric($template_name)) { + if ($template_name == 'header' || $template_name == 'footer') { + $template_html = str_replace('name="cart"', 'name="view_cart"', $template_html); + $updates[] = "$template_name = '$template_html'"; + } else { + $template_html = str_replace('name="cart"', 'name="add_to_cart"', $template_html); + $updates[] = "$template_name = '$template_html'"; + } + } + } + $update_string = implode($updates,","); + if ($database->query("UPDATE ".TABLE_PREFIX."mod_bakery_page_settings SET $update_string WHERE section_id = '{$page_settings['section_id']}'")) { + if ($replace_counter == 0) { + echo "Replaced all submit buttons named "cart" by "view_cart" or "add_to_cart"…
"; + } + echo " – in all page templates with section id {$page_settings['section_id']} successfully
"; + $display_warning = true; + $replace_counter++; + } else { + echo ''.$database->get_error().'
'; + } + } + // Upgrade note + if ($display_warning) { + echo ' +
+

IMPORTANT UPGRADE NOTES UPGRADING TO v1.4.0

+

Due to the new delivery notes printing feature you have to modify your invoice template slightly.

+
    +
  1. Go to "Payment Methods" > select "Invoice" > "Invoice Template".
  2. +
  3. Replace the placeholder [INVOICE_OR_DUNNING] by [TITLE].
  4. +
  5. Replace some lines of html code at the bottom of the invoice template by the appropriate ones. See example code at the Bakery website. +
    Use the help page at "Payment Methods" > select "Invoice" > "Invoice Template" > "Help" to get information on the new placeholders [DISPLAY_INVOICE], [DISPLAY_DELIVERY_NOTE] and [DISPLAY_REMINDER].
  6. +
+

If your shop frontend is not working as expected please check all of your page templates manually.

+
    +
  1. Select a Bakery page and go to "Page Settings" > "Layout Settings".
  2. +
  3. Make sure all submit buttons formerly named name="cart" have been replaced correctly by the upgrade script:
  4. +
      +
    • Set name="view_cart" for submit buttons that jump to the cart view.
    • +
    • Set name="add_to_cart" for submit buttons that add items to the cart.
    • +
    +
  5. Repeat for all other Bakery pages.
  6. +
+
+'; + } + } +} + + + + +// UPGRADE TO VERSION 1.5.1 +// ************************ + +if ($module_version < 1.51) { + + // Titel: Upgrading to + echo'

Upgrading to version 1.5.1:

'; + + // Get GENERAL SETTINGS table to see what needs to be created + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + $settings = $settingstable->fetchRow(); + + // Adding new fields to the existing SETTINGS table + echo'Adding new field to the general_settings table
'; + + if (!array_key_exists('pages_directory', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `pages_directory` VARCHAR(20) NOT NULL DEFAULT 'bakery' AFTER `shop_email`")) { + echo 'Database field pages_directory added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field pages_directory exists, update not needed
'; } + +} + + + + +// UPGRADE TO VERSION 1.5.5 +// ************************ + +if ($module_version < 1.55) { + echo ' +
+

IMPORTANT UPGRADE NOTES UPGRADING TO BAKERY v1.5.5

+

This upgrade note only concerns users of the DIRECTebanking.com / sofortüberweisung.de payment method.

+

As a new payment method security feature DIRECTebanking.com / sofortüberweisung.de now supports a notification password. This password is used to verify the HTTP response notifications. All users of this payment method have to add a notification password otherwise the payment method will not work properly any more.

+

In order to set the notification password follow the steps below:

+
    +
  1. Log in to your DIRECTebanking.com / sofortüberweisung.de account.
  2. +
  3. Go to "My projects" > select a project > "Extended settings" > "Passwords and hash algorithm"
  4. +
  5. Set the notification password. Please note: As soon as the password is set, it can not be unset anymore.
  6. +
  7. Copy or write down the generated notification password for later use.
  8. +
    +
  9. Log in to the Bakery backend.
  10. +
  11. Add the DIRECTebanking.com / sofortüberweisung.de notification password at "Payment Methods" > select "DIRECTebanking.com / sofortüberweisung.de" > "DIRECTebanking.com / sofortüberweisung.de Settings".
  12. +
+
+'; +} + + + + +// UPGRADE TO VERSION 1.6 +// ********************** + +if ($module_version < 1.60) { + + // Titel: Upgrading to + echo'

Upgrading to version 1.6.0:

'; + + // Get COSTUMER table to see what needs to be changed + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + if ($costumer = $customertable->fetchRow()) { + + if (!array_key_exists('cust_tax_no', $costumer)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `cust_tax_no` VARCHAR(11) NOT NULL AFTER `cust_last_name`;")) { + echo 'Database field cust_tax_no added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field cust_tax_no exists, update not needed
'; } + } + + + // Get GENERAL SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + if ($settings = $settingstable->fetchRow()) { + + if (!array_key_exists('tax_no_field', $settings)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `tax_no_field` ENUM('show', 'hide') NOT NULL AFTER `state_field`")) { + echo 'Database field tax_no_field added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field tax_no_field exists, update not needed
'; } + + // Include default EU tax zone file + include(WB_PATH.'/modules/bakery/eu_tax_zone.php'); + + if (!array_key_exists('tax_group', $settings)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `tax_group` VARCHAR(255) NOT NULL DEFAULT '$tax_group' AFTER `tax_no_field`")) { + echo 'Database field tax_group added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field tax_group exists, update not needed
'; } + } +} + + + + +// UPGRADE TO VERSION 1.7 +// ********************** + +if ($module_version < 1.70) { + + // Titel: Upgrading to + echo'

Upgrading to version 1.7.0:

'; + + // Get COSTUMER table to see what needs to be changed + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + if ($costumer = $customertable->fetchRow()) { + + if (!array_key_exists('cust_company', $costumer)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `cust_company` VARCHAR(50) NOT NULL AFTER `user_id`;")) { + echo 'Database field cust_company added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field cust_company exists, update not needed
'; } + + if (!array_key_exists('ship_company', $costumer)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `ship_company` VARCHAR(50) NOT NULL AFTER `cust_phone`;")) { + echo 'Database field ship_company added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field ship_company exists, update not needed
'; } + + if (!array_key_exists('invoice_id', $costumer)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `invoice_id` INT(6) NOT NULL AFTER `ship_zip`;")) { + echo 'Database field invoice_id added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field invoice_id exists, update not needed
'; } + } + + + // Get GENERAL SETTINGS table to see what needs to be changed + $settingstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_general_settings`"); + if ($settings = $settingstable->fetchRow()) { + + if (!array_key_exists('company_field', $settings)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `company_field` ENUM('show','hide') NOT NULL AFTER `shipping_form`")) { + echo 'Database field company_field added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field company_field exists, update not needed
'; } + + if (!array_key_exists('cust_msg', $settings)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` ADD `cust_msg` ENUM('show','hide') NOT NULL AFTER `zip_location`")) { + echo 'Database field cust_msg added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field cust_msg exists, update not needed
'; } + + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` CHANGE `shop_state` `shop_state` VARCHAR(5) NOT NULL")) { + echo 'Changed database field shop_state to type VARCHAR(5) successfully
'; + } else { + echo ''.$database->get_error().'
'; + } + + if (array_key_exists('skip_checkout', $settings)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_general_settings` DROP `skip_checkout`")) { + echo 'Database field skip_checkout deleted successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field skip_checkout does not exist, update not needed
'; } + + } + + + // Get ITEMS table to see what needs to be changed + $itemstable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_items`"); + if ($items = $itemstable->fetchRow()) { + + if (!array_key_exists('created_when', $items)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` ADD `created_when` INT NOT NULL DEFAULT '0' AFTER `modified_by`")) { + echo 'Database field created_when added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field created_when exists, update not needed
'; } + + if (!array_key_exists('created_by', $items)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` ADD `created_by` INT NOT NULL DEFAULT '0' AFTER `created_when`")) { + echo 'Database field created_by added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field created_by exists, update not needed
'; } + + if (array_key_exists('main_image', $items)){ + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_items` DROP `main_image`")) { + echo 'Database field main_image deleted successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field main_image does not exist, update not needed
'; } + + } +} + + +// Add new images table to the database +echo'Adding new images table to the database
'; + +// Create new GENERAL SETTINGS table +$mod_bakery = 'CREATE TABLE `'.TABLE_PREFIX.'mod_bakery_images` ( ' + . "`img_id` int(11) NOT NULL AUTO_INCREMENT," + . "`item_id` int(11) NOT NULL DEFAULT '0'," + . "`item_attribute_id` int(11) NOT NULL DEFAULT '0'," + . "`filename` varchar(150) NOT NULL DEFAULT ''," + . "`active` enum('1','0') NOT NULL DEFAULT '1'," + . "`position` int(11) NOT NULL DEFAULT '0'," + . "`alt` varchar(255) NOT NULL DEFAULT ''," + . "`title` varchar(255) NOT NULL DEFAULT ''," + . "`caption` text NOT NULL," + . "PRIMARY KEY (`img_id`)" + . ' )'; +if ($database->query($mod_bakery)) { + echo 'Created new images table successfully
'; +} +else { + echo ''.$database->get_error().'
'; +} + + + echo ' +
+

IMPORTANT UPGRADE NOTES UPGRADING TO BAKERY v1.7.0

+

This version features a big improvement in handling item images. It is now possible to reorder item images, add a title, alt attribute and even a image caption. The image on the top position will be used as main image.

+

In order to set the image settings you have to open each item in the Bakery backend:

+
    +
  1. The database will then be synced automatically with the item images currently saved in the /media/bakery/ directory.
  2. +
  3. Please enter your image data.
  4. +
  5. If you set a title and no alt attribute, the title will be copied and used for the alt attribute as well.
  6. +
  7. The alt attribute is mandatory.
  8. +
  9. The image at the top position (position 1) will be used as main image.
  10. +
  11. If you enter a image caption, the image will be wrapped in a <div> container and the image will be followed after a <br> by your caption.
  12. +
  13. The item attribut generates a unique id like mod_bakery_img_attrXX_f where the XX stands for the image attribute id. This can be used for any JavaScript actions depending on the selected option attribute. Eg. change main image depending on selected item option.
  14. +
  15. Not used images can be deactivated or deleted in the backend.
  16. +
+
+'; + + + + +// UPGRADE TO VERSION 1.7.2 +// ************************ + +if ($module_version < 1.72) { + + // Titel: Upgrading to + echo'

Upgrading to version 1.7.2:

'; + + // Get COSTUMER table to see what needs to be changed + $customertable = $database->query("SELECT * FROM `".TABLE_PREFIX."mod_bakery_customer`"); + if ($costumer = $customertable->fetchRow()) { + + if (!array_key_exists('sent_invoices', $costumer)) { + if ($database->query("ALTER TABLE `".TABLE_PREFIX."mod_bakery_customer` ADD `sent_invoices` INT(1) NOT NULL DEFAULT '0' AFTER `invoice_id`;")) { + echo 'Database field sent_invoices added successfully
'; + } else { echo ''.$database->get_error().'
'; } + } else { echo 'Database field sent_invoices exists, update not needed
'; } + } +} + + + + + + + + +// STOP FOR DEBUGGING - DISPLAY ERROR LOG +// ************************************** +?> +

+
+

Please check the upgrade log carefully. Save a copy for later use. Then click…

+
+ + +
+print_footer(); +?> + + diff --git a/view.php b/view.php new file mode 100644 index 0000000..89b8485 --- /dev/null +++ b/view.php @@ -0,0 +1,588 @@ +query("SELECT user_id,username,display_name,email FROM ".TABLE_PREFIX."users"); +if ($query_users->numRows() > 0) { + while ($user = $query_users->fetchRow()) { + // Insert user info into users array + $user_id = $user['user_id']; + $users[$user_id]['username'] = $user['username']; + $users[$user_id]['display_name'] = $user['display_name']; + $users[$user_id]['email'] = $user['email']; + } +} + +// Update the section id of the last visited Bakery section for use with MiniCart +$_SESSION['bakery']['last_section_id'] = $section_id; + +// Get general settings +$query_general_settings = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_general_settings"); +if ($query_general_settings->numRows() > 0) { + $fetch_general_settings = $query_general_settings->fetchRow(); + + $setting_shop_name = stripslashes($fetch_general_settings['shop_name']); + $setting_shop_email = stripslashes($fetch_general_settings['shop_email']); + $setting_tac_url = stripslashes($fetch_general_settings['tac_url']); + $setting_shop_country = stripslashes($fetch_general_settings['shop_country']); + $setting_shop_state = stripslashes($fetch_general_settings['shop_state']); + $setting_shipping_form = stripslashes($fetch_general_settings['shipping_form']); + $setting_company_field = stripslashes($fetch_general_settings['company_field']); + $setting_state_field = stripslashes($fetch_general_settings['state_field']); + $setting_tax_no_field = stripslashes($fetch_general_settings['tax_no_field']); + $setting_tax_group = stripslashes($fetch_general_settings['tax_group']); + $setting_zip_location = stripslashes($fetch_general_settings['zip_location']); + $setting_cust_msg = stripslashes($fetch_general_settings['cust_msg']); + $setting_skip_cart = stripslashes($fetch_general_settings['skip_cart']); + $setting_use_captcha = stripslashes($fetch_general_settings['use_captcha']); + + $setting_definable_field_0 = stripslashes($fetch_general_settings['definable_field_0']); + $setting_definable_field_1 = stripslashes($fetch_general_settings['definable_field_1']); + $setting_definable_field_2 = stripslashes($fetch_general_settings['definable_field_2']); + $setting_stock_mode = stripslashes($fetch_general_settings['stock_mode']); + $setting_stock_limit = stripslashes($fetch_general_settings['stock_limit']); + $setting_out_of_stock_orders = stripslashes($fetch_general_settings['out_of_stock_orders']); + + $setting_shop_currency = stripslashes($fetch_general_settings['shop_currency']); + $setting_dec_point = stripslashes($fetch_general_settings['dec_point']); + $setting_thousands_sep = stripslashes($fetch_general_settings['thousands_sep']); + $setting_tax_by = stripslashes($fetch_general_settings['tax_by']); + $setting_tax_rate = stripslashes($fetch_general_settings['tax_rate']); + $setting_tax_rate1 = stripslashes($fetch_general_settings['tax_rate1']); + $setting_tax_rate2 = stripslashes($fetch_general_settings['tax_rate2']); + $setting_tax_included = stripslashes($fetch_general_settings['tax_included']); + + $setting_tax_rate_shipping = stripslashes($fetch_general_settings['tax_rate_shipping']); + $setting_free_shipping = stripslashes($fetch_general_settings['free_shipping']); + $setting_free_shipping_msg = stripslashes($fetch_general_settings['free_shipping_msg']); + $setting_shipping_method = stripslashes($fetch_general_settings['shipping_method']); + $setting_shipping_domestic = stripslashes($fetch_general_settings['shipping_domestic']); + $setting_shipping_abroad = stripslashes($fetch_general_settings['shipping_abroad']); + $setting_shipping_zone = stripslashes($fetch_general_settings['shipping_zone']); + $setting_zone_countries = explode(",", stripslashes($fetch_general_settings['zone_countries'])); // make array + $setting_shipping_d_a = $setting_shipping_domestic."/".$setting_shipping_abroad; +} + +// Get payment method settings +$query_payment_methods = $database->query("SELECT directory FROM ".TABLE_PREFIX."mod_bakery_payment_methods WHERE active = '1'"); +if ($query_payment_methods->numRows() > 0) { + while ($fetch_payment_methods = $query_payment_methods->fetchRow()) { + $setting_payment_methods[] = stripslashes($fetch_payment_methods['directory']); + } +} else { + $setting_payment_methods = array(); +} +$num_payment_methods = count($setting_payment_methods); + +// Get page settings +$query_page_settings = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_page_settings WHERE section_id = '$section_id'"); +if ($query_page_settings->numRows() > 0) { + $fetch_page_settings = $query_page_settings->fetchRow(); + + $setting_page_offline = stripslashes($fetch_page_settings['page_offline']); + $setting_offline_text = stripslashes($fetch_page_settings['offline_text']); + $setting_header = stripslashes($fetch_page_settings['header']); + $setting_item_loop = stripslashes($fetch_page_settings['item_loop']); + $setting_footer = stripslashes($fetch_page_settings['footer']); + $setting_item_header = stripslashes($fetch_page_settings['item_header']); + $setting_item_footer = stripslashes($fetch_page_settings['item_footer']); + $setting_items_per_page = $fetch_page_settings['items_per_page']; + $setting_num_cols = $fetch_page_settings['num_cols']; + $setting_resize = stripslashes($fetch_page_settings['resize']); + $setting_lightbox2 = stripslashes($fetch_page_settings['lightbox2']); +} else { + $setting_page_offline = 'no'; + $setting_offline_text = ''; + $setting_header = ''; + $setting_item_loop = ''; + $setting_footer = ''; + $setting_item_header = ''; + $setting_item_footer = ''; + $setting_items_per_page = 1; + $setting_num_cols = 3; + $setting_resize = 100; + $setting_lightbox2 = 'detail'; +} + +// Get continue url +$query_continue_url = $database->query("SELECT p.link FROM ".TABLE_PREFIX."pages p INNER JOIN ".TABLE_PREFIX."mod_bakery_page_settings ps ON p.page_id = ps.page_id WHERE p.page_id = ps.continue_url AND ps.section_id = '$section_id'"); +if ($query_continue_url->numRows() > 0) { + $fetch_continue_url = $query_continue_url->fetchRow(); + $setting_continue_url = WB_URL.PAGES_DIRECTORY.stripslashes($fetch_continue_url['link']).PAGE_EXTENSION; +} + +// Add a wrapper for Bakery to help with layout +echo "\n
\n"; +$end_of_wrapper = "\n
\n"; + + + + + + + + +// ***************************************************************************************** // +// Check if we should show the SHOPPING CART, PROCESS ORDER, the MAIN PAGE or an ITEM itself // +// ***************************************************************************************** // + + +// GENERATE ORDER ID FOR NEW ORDERS +// ******************************** + +// MSIE image buttons only submit the click coordinates like 'anything_x' and 'anything_y' +// Convert POST name 'anything_x' to 'anything' +if (strpos($_SERVER['HTTP_USER_AGENT'], "MSIE")) { + foreach ($_POST as $key => $value) { + $count = 0; + $ie_post_key = str_replace('_x', '', $key, $count); + if ($count > 0) { + $_POST[$ie_post_key] = 1; + } + } +} + +// Check submitted POST/GET vars +if (isset($_REQUEST['view_cart']) && ($_REQUEST['view_cart'] != '') || // normally POST, GET for MiniCart + isset($_POST['add_to_cart']) && ($_POST['add_to_cart'] != '') || + isset($_POST['update_cart']) && ($_POST['update_cart'] != '') || + isset($_POST['submit_order']) && ($_POST['submit_order'] != '') || + isset($_POST['hide_ship_form']) && ($_POST['hide_ship_form'] != '') || + isset($_POST['add_ship_form']) && ($_POST['add_ship_form'] != '')) { + + // Check order id + if (!isset($_SESSION['bakery']['order_id']) || ($_SESSION['bakery']['order_id'] == '')) { + $mktime = @mktime(); + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_customer (order_date) VALUES ('$mktime')"); + $order_id = $database->get_one("SELECT LAST_INSERT_ID()"); + $_SESSION['bakery']['order_id'] = $order_id; + + // Delete db records of not submitted orders older than 1 hour + $outdate = $mktime - (60 * 60 * 1); + $query_outdated_orders = $database->query("SELECT order_id FROM " .TABLE_PREFIX."mod_bakery_customer WHERE order_date < $outdate AND submitted = 'no'"); + if ($query_outdated_orders->numRows() > 0) { + while ($outdated_orders = $query_outdated_orders->fetchRow()) { + $outdated_order_id = stripslashes($outdated_orders['order_id']); + + // First put not sold items back to stock... + $query_order = $database->query("SELECT item_id, quantity FROM " .TABLE_PREFIX."mod_bakery_order WHERE order_id = '$outdated_order_id'"); + if ($query_order->numRows() > 0) { + while ($order = $query_order->fetchRow()) { + $item_id = stripslashes($order['item_id']); + $quantity = stripslashes($order['quantity']); + // Query item stock + $query_items = $database->query("SELECT stock FROM " .TABLE_PREFIX."mod_bakery_items WHERE item_id = '$item_id'"); + $item = $query_items->fetchRow(); + $stock = stripslashes($item['stock']); + // Only use stock admin if stock is not blank + if (is_numeric($stock) && $stock != '') { + // Update stock to required quantity + $database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET stock = stock + '$quantity' WHERE item_id = '$item_id'"); + } + } + } + + // ...then delete not submitted orders + $database->query("DELETE FROM " .TABLE_PREFIX."mod_bakery_customer WHERE order_id = '$outdated_order_id' AND submitted = 'no'"); + $database->query("DELETE FROM " .TABLE_PREFIX."mod_bakery_order WHERE order_id = '$outdated_order_id'"); + } + } + } + $order_id = $_SESSION['bakery']['order_id']; + + + + // SHOPPING CART FUNCTIONS + // *********************** + + + // PUT ITEM INTO THE CART + if (isset($_POST['add_to_cart']) && ($_POST['add_to_cart'] != '')) { + + // Get item ID and quantity ( -> $value) + $sql_result1 = $database->query("SELECT * FROM " .TABLE_PREFIX."mod_bakery_order WHERE order_id = '$order_id'"); + + foreach ($_POST as $field => $value) { + // Error message if quantity < 1 + if (substr($field,0,4) == "item" && $value < 1) { + $cart_error[] = $MOD_BAKERY['ERR_QUANTITY_ZERO']; + } + if (substr($field,0,4) == "item" && $value > 0) { + // Get item_id + $item_id = substr($field,4,strlen($field)-4); + // Get item attributes and make comma separated string + if (isset($_POST['attribute'][0])) { + $attributes = implode(",", $_POST['attribute']); + } else { + // If no attribute is given set it to "none" + $attributes = "none"; + } + + // Error message if item is in cart already + while ($row1 = $sql_result1->fetchRow()) { + if ($row1['item_id'] == $item_id && $row1['attributes'] == $attributes) { + $cart_error[] = $MOD_BAKERY['ERR_ITEM_EXISTS']; + include('view_cart.php'); + echo $end_of_wrapper; // End of bakery wrapper + return; + } + } + + // Get item price, sku, stock and tax_rate + $sql_result2 = $database->query("SELECT title, price, sku, stock, tax_rate FROM " .TABLE_PREFIX."mod_bakery_items WHERE item_id = '$item_id'"); + $row2 = $sql_result2->fetchRow(); + $row2 = array_map('stripslashes', $row2); + $title = $row2['title']; + $sku = $row2['sku']; + $price = $row2['price']; + $tax_rate = $row2['tax_rate']; + $stock = $row2['stock']; + $quantity = $value; + + // Only use stock admin if stock is not blank + if (is_numeric($stock) && $stock != '') { + // If item is short of stock show error message + if ($setting_out_of_stock_orders) { + + // Case: Allow out of stock orders + if ($stock < $value) { + $cart_error[] = "{$MOD_BAKERY['TXT_SHORT_OF_STOCK_SUBSEQUENT_DELIVERY']}!
$stock {$MOD_BAKERY['TXT_ITEMS']} $title {$MOD_BAKERY['TXT_AVAILABLE_QUANTITY']}."; + } + // Update stock + $database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET stock = stock - '$value' WHERE item_id = '$item_id'"); + + } else { + // Case: No out of stock orders + // If item is short of stock... + if ($stock <= $value) { + // ...set quantity to remaining stock + $quantity = $stock; + // Show error message + if ($stock < $value) { + $cart_error[] = "$quantity {$MOD_BAKERY['TXT_ITEMS']} $title {$MOD_BAKERY['TXT_AVAILABLE_QUANTITY']}.
{$MOD_BAKERY['TXT_SHORT_OF_STOCK_QUANTITY_CAPPED']}!"; + } + } + // Update stock + $database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET stock = stock - '$quantity' WHERE item_id = '$item_id'"); + } + } + // Insert ordered item data into db + if ($quantity > 0) { + $database->query("INSERT INTO " .TABLE_PREFIX."mod_bakery_order (order_id, item_id, attributes, sku, quantity, price, tax_rate) VALUES ('$order_id', '$item_id', '$attributes', '$sku', '$quantity', '$price', '$tax_rate')"); + } + } + } + + // If required skip cart + if ($setting_skip_cart == "yes") { + include('view_overview.php'); + echo $end_of_wrapper; // End of bakery wrapper + unset($_SESSION['bakery']['minicart']); + return; + } else { + // Show cart + include('view_cart.php'); + echo $end_of_wrapper; // End of bakery wrapper + return; + } + } + + + // UPDATE CART + elseif (isset($_POST['update_cart']) && ($_POST['update_cart'] != '')) { + + // Update quantities in db + foreach ($_POST['quantity'] as $item_id => $attributes) { + foreach ($_POST['quantity'][$item_id] as $attributes => $quantity) { + $item_id = strip_tags($item_id); + $attributes = strip_tags($attributes); + $quantity = abs(strip_tags($quantity)); + + // Query item stock + $query_items = $database->query("SELECT title, stock FROM " .TABLE_PREFIX."mod_bakery_items WHERE item_id = '$item_id'"); + $item = $query_items->fetchRow(); + $title = stripslashes($item['title']); + $stock = stripslashes($item['stock']); + + // Only use stock admin if stock is not blank + if (is_numeric($stock) && $stock != '') { + // If item is short of stock show error message + if ($setting_out_of_stock_orders) { + + // Case: Allow out of stock orders + // Query current item quantity + $query_order = $database->query("SELECT quantity FROM " .TABLE_PREFIX."mod_bakery_order WHERE order_id = '$order_id' AND item_id = '$item_id' AND attributes = '$attributes'"); + $order = $query_order->fetchRow(); + $quantity_current = stripslashes($order['quantity']); + // Calculate difference + $quantity_diff = $quantity - $quantity_current; + // If items are short of stock show error message + if ($stock < $quantity_diff) { + $cart_error[0] = "{$MOD_BAKERY['TXT_SHORT_OF_STOCK_SUBSEQUENT_DELIVERY']}!"; + $available_quantity = $stock + $quantity_current; + $cart_error[] = "$available_quantity {$MOD_BAKERY['TXT_ITEMS']} $title {$MOD_BAKERY['TXT_AVAILABLE_QUANTITY']}."; + } + // Update stock to required quantity + $database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET stock = stock - '$quantity_diff' WHERE item_id = '$item_id'"); + + } else { + // Case: No out of stock orders + // Query current item quantity + $query_order = $database->query("SELECT quantity FROM " .TABLE_PREFIX."mod_bakery_order WHERE order_id = '$order_id' AND item_id = '$item_id' AND attributes = '$attributes'"); + $order = $query_order->fetchRow(); + $quantity_current = stripslashes($order['quantity']); + // Calculate difference + $quantity_diff = $quantity - $quantity_current; + // If item is short of stock... + if ($stock <= $quantity_diff) { + // Set quantity to sum of remaining stock and current number of items in cart + $quantity = $stock + $quantity_current; + // Update stock abd deactivate item + $database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET stock = '0' WHERE item_id = '$item_id'"); + // Compose error message + if ($stock < $quantity_diff) { + $cart_error[] = "$quantity {$MOD_BAKERY['TXT_ITEMS']} $title {$MOD_BAKERY['TXT_AVAILABLE_QUANTITY']}."; + } + } + // Stock is large enough + else { + // Update stock to required quantity and make sure item is activated + $database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET stock = stock - '$quantity_diff' WHERE item_id = '$item_id'"); + } + } + } + // Update item order quantity + $database->query("UPDATE " .TABLE_PREFIX."mod_bakery_order SET quantity = '$quantity' WHERE order_id = '$order_id' AND item_id = '$item_id' AND attributes = '$attributes'"); + } + } + + // Add opening paragraph to the error message + if (isset($cart_error) && !$setting_out_of_stock_orders) { + $cart_error[] = "{$MOD_BAKERY['TXT_SHORT_OF_STOCK_QUANTITY_CAPPED']}!"; + } + + // Delete ordered items with quantity 0 + $database->query("DELETE FROM " .TABLE_PREFIX."mod_bakery_order WHERE quantity = '0' AND order_id = '$order_id'"); + + // Enable success message to show in view_cart.php + $cart_success = true; + + // Show cart + include('view_cart.php'); + echo $end_of_wrapper; // End of bakery wrapper + return; + } + + + // SHOW ADDRESS FORM(S) + elseif (!empty($_POST['submit_order']) || !empty($_POST['add_ship_form']) || !empty($_POST['hide_ship_form'])) { + include('view_form.php'); + echo $end_of_wrapper; // End of bakery wrapper + return; + } + + + // SHOW CART ONLY + else { + include('view_cart.php'); + echo $end_of_wrapper; // End of bakery wrapper + return; + } +} + + + +// SHOW ADDRESS FORM FOR MODIFYING +// ******************************* + +elseif (isset($_POST['modify_address']) && isset($_SESSION['bakery']['order_id']) && ($_SESSION['bakery']['order_id'] != '')) { + include('view_form.php'); + echo $end_of_wrapper; // End of bakery wrapper + return; +} + + + +// CHECK ADDRESS FORM, SAVE CUSTOMER DATA, THEN SHOW PAYMENT METHODS +// ***************************************************************** + +elseif (isset($_POST['save_form']) && isset($_SESSION['bakery']['order_id']) && ($_SESSION['bakery']['order_id'] != '')) { + include('save_form.php'); + echo $end_of_wrapper; // End of bakery wrapper + return; +} + + + +// SHOW PAYMENT METHODS +// ******************** + +elseif (isset($_POST['pay_methods']) && isset($_SESSION['bakery']['order_id']) && ($_SESSION['bakery']['order_id'] != '')) { + include('view_pay_methods.php'); + echo $end_of_wrapper; // End of bakery wrapper + return; +} + + + +// CANCEL ORDER +// ************ + +elseif (isset($_POST['cancel_order']) && isset($_SESSION['bakery']['order_id']) && ($_SESSION['bakery']['order_id'] != '')) { + + // Get order id + $order_id = $_SESSION['bakery']['order_id']; + // First put not sold items back to stock... + $query_order = $database->query("SELECT item_id, quantity FROM " .TABLE_PREFIX."mod_bakery_order WHERE order_id = '$order_id'"); + if ($query_order->numRows() > 0) { + while ($order = $query_order->fetchRow()) { + $item_id = stripslashes($order['item_id']); + $quantity = stripslashes($order['quantity']); + // Query item stock + $query_items = $database->query("SELECT stock FROM " .TABLE_PREFIX."mod_bakery_items WHERE item_id = '$item_id'"); + $item = $query_items->fetchRow(); + $stock = stripslashes($item['stock']); + // Only use stock admin if stock is not blank + if (is_numeric($stock) && $stock != '') { + // Update stock to required quantity + $database->query("UPDATE ".TABLE_PREFIX."mod_bakery_items SET stock = stock + '$quantity' WHERE item_id = '$item_id'"); + } + } + } + + // Delete the db records not needed any more + $database->query("DELETE FROM " .TABLE_PREFIX."mod_bakery_customer WHERE order_id='$order_id' AND submitted='no'"); + $database->query("DELETE FROM " .TABLE_PREFIX."mod_bakery_order WHERE order_id='$order_id'"); + + // Clean up the session array + unset($_SESSION['bakery']); + + // Order canceled by user => show message + echo "

{$MOD_BAKERY['TXT_CANCEL']}

"; + echo "

{$MOD_BAKERY['TXT_DELETED']}

"; + echo "

{$MOD_BAKERY['TXT_THANK_U_VISIT']}

"; + echo $end_of_wrapper; // End of bakery wrapper + return; +} + + + +// VIEW SUMMARY PAGE +// ***************** + +elseif (isset($_POST['summary']) && isset($_SESSION['bakery']['order_id']) && ($_SESSION['bakery']['order_id'] != '')) { + // View payment methods + include('view_summary.php'); + echo $end_of_wrapper; // End of bakery wrapper + return; +} + + + +// SUBMIT FINAL ORDER +// ****************** + +elseif (isset($_POST['checkout']) && isset($_SESSION['bakery']['order_id']) && ($_SESSION['bakery']['order_id'] != '')) { + $payment_method = $_SESSION['bakery']['payment_method']; + if (is_file(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/check_payment.php')) { + include(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/check_payment.php'); + echo $end_of_wrapper; // End of bakery wrapper + } +} + + + +// CHECK PAYMENT STATUS AND VIEW CONFIRMATION +// ****************************************** + +elseif (isset($_SESSION['bakery']['order_id']) && !empty($_SESSION['bakery']['order_id']) && + ((isset($_REQUEST['payment_method']) && in_array($_REQUEST['payment_method'], $setting_payment_methods)) || + (isset($_REQUEST['pm']) && in_array($_REQUEST['pm'], $setting_payment_methods)))) { + + // Get the payment method + if (isset($_REQUEST['payment_method'])) { + $payment_method = $_REQUEST['payment_method']; + } elseif (isset($_REQUEST['pm'])) { + $payment_method = $_REQUEST['pm']; + } else { + $payment_method = ''; + } + + // Check the status of the payment (error/canceled/success/pending) + if ($payment_method == $_SESSION['bakery']['payment_method']) { + require(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/check_payment.php'); + } else { + $payment_status = 'error'; + } + + // Display error/canceled message OR in case of success/pending display confirmation and send emails + require(WB_PATH.'/modules/bakery/view_confirmation.php'); + + // Assign page filename for tracking with Google Analytics _trackPageview() function + global $ga_page; + $ga_page = "/$payment_method/$payment_status.php"; + + echo $end_of_wrapper; // End of bakery wrapper + return; +} + + + +// SET PAGE OFFLINE FOR MAINTENANCE +// ******************************** + +elseif ($setting_page_offline == 'yes') { + echo '

'.$setting_offline_text.'

'; + echo $end_of_wrapper; // End of bakery wrapper + return; +} + + + +// SHOW OVERVIEW PAGE +// ****************** + +elseif (!defined('ITEM_ID') OR !is_numeric(ITEM_ID)) { + include('view_overview.php'); + echo $end_of_wrapper; // End of bakery wrapper +} + + + +// SHOW ITEM DETAIL PAGE +// ********************* + +elseif (defined('ITEM_ID') AND is_numeric(ITEM_ID)) { + include('view_item.php'); + echo $end_of_wrapper; // End of bakery wrapper +} \ No newline at end of file diff --git a/view_cart.php b/view_cart.php new file mode 100644 index 0000000..1480b94 --- /dev/null +++ b/view_cart.php @@ -0,0 +1,283 @@ +set_unknowns('keep'); +// Define debug mode (0:=disabled (default), 1:=variable assignments, 2:=calls to get variable, 4:=debug internals) +$tpl->debug = 0; + + + +// EMPTY CART +// ********** + +// If cart is empty, show an error message and a "continue shopping" button +$sql_result1 = $database->query("SELECT * FROM " .TABLE_PREFIX."mod_bakery_order WHERE order_id = '$order_id'"); +$n_row = $sql_result1->numRows(); +if ($n_row < 1) { + // Show empty cart error message using template file + $tpl->set_file('empty_cart', 'empty.htm'); + $tpl->set_var(array( + 'ERR_CART_EMPTY' => $MOD_BAKERY['ERR_CART_EMPTY'], + 'TXT_CONTINUE_SHOPPING' => $MOD_BAKERY['TXT_CONTINUE_SHOPPING'] + )); + $tpl->pparse('output', 'empty_cart'); + return; +} + + + +// GET ITEM DETAILS FROM DATABASE +// ****************************** + +// Get order id, item id, attributes, sku, quantity, price and tax_rate from db table order +$i = 1; +while ($row1 = $sql_result1->fetchRow()) { + foreach ($row1 as $field => $value) { + if ($field != "order_id") { + $items[$i][$field] = $value; + // Get item name, shipping. link and main image from db items table + if ($field == "item_id") { + $sql_result2 = $database->query("SELECT title, shipping, link FROM ".TABLE_PREFIX."mod_bakery_items WHERE item_id = '".$row1['item_id']."'"); + $row2 = $sql_result2->fetchRow(); + $items[$i]['name'] = $row2[0]; + $items[$i]['shipping'] = $row2[1]; + $items[$i]['link'] = WB_URL.PAGES_DIRECTORY.$row2[2].PAGE_EXTENSION; + + // Item thumbnail + // Default if no thumb exists + $items[$i]['thumb_url'] = WB_URL.'/modules/bakery/images/transparent.gif'; + $items[$i]['thumb_width'] = $cart_thumb_max_size; + $items[$i]['thumb_height'] = $cart_thumb_max_size; + // Get main thumb (image with position == 1) + $main_thumb = ''; + $main_thumb = $database->get_one("SELECT `filename` FROM ".TABLE_PREFIX."mod_bakery_images WHERE `item_id` = '{$row1['item_id']}' AND `active` = '1' ORDER BY `position` ASC LIMIT 1"); + $main_thumb = str_replace(".png", ".jpg", $main_thumb); + // Item thumb if exists + $thumb_dir = '/bakery/thumbs/item'.$row1['item_id'].'/'; + $items[$i]['thumb_path'] = WB_PATH.MEDIA_DIRECTORY.$thumb_dir.$main_thumb; + if (is_file($items[$i]['thumb_path'])) { + // Thumb URL + $items[$i]['thumb_url'] = WB_URL.MEDIA_DIRECTORY.$thumb_dir.$main_thumb; + // Get thumb image size + $size = getimagesize($items[$i]['thumb_path']); + if ($size[0] > 1 && $size[1] > 1) { + if ($size[0] > $size[1]) { + $items[$i]['thumb_height'] = round($cart_thumb_max_size * $size[1] / $size[0]); + } + elseif ($size[0] < $size[1]) { + $items[$i]['thumb_width'] = round($cart_thumb_max_size * $size[0] / $size[1]); + } + } + } + } + } + } + + // Default if item has no attributes + $items[$i]['show_attribute'] = ''; + $items[$i]['attribute_price'] = 0; + // Get item attribute ids + if ($items[$i]['attributes'] != "none") { + $attribute_ids = explode(",", $items[$i]['attributes']); + foreach ($attribute_ids as $attribute_id) { + // Get option name and attribute name, price, operator (+/-/=) + $query_attributes = $database->query("SELECT o.option_name, a.attribute_name, ia.price, ia.operator FROM ".TABLE_PREFIX."mod_bakery_options o INNER JOIN ".TABLE_PREFIX."mod_bakery_attributes a ON o.option_id = a.option_id INNER JOIN ".TABLE_PREFIX."mod_bakery_item_attributes ia ON a.attribute_id = ia.attribute_id WHERE ia.item_id = {$items[$i]['item_id']} AND ia.attribute_id = $attribute_id"); + $attribute = $query_attributes->fetchRow(); + // Calculate the item attribute prices sum depending on the operator + if ($attribute['operator'] == "+") { + $items[$i]['attribute_price'] = $items[$i]['attribute_price'] + $attribute['price']; + } elseif ($attribute['operator'] == "-") { + $items[$i]['attribute_price'] = $items[$i]['attribute_price'] - $attribute['price']; + // If operator is '=' then override the item price by the attribute price + } elseif ($attribute['operator'] == "=") { + $items[$i]['price'] = $attribute['price']; + } + // Prepare option and attributes for display in cart table + $items[$i]['show_attribute'] .= ", ".$attribute['option_name'].": ".$attribute['attribute_name']; + } + // Now calculate item price including all attribute prices + $items[$i]['price'] = $items[$i]['price'] + $items[$i]['attribute_price']; + // Never undercut zero + $items[$i]['price'] = $items[$i]['price'] < 0 ? 0 : $items[$i]['price']; + // Remove leading comma and space + $items[$i]['show_attribute'] = substr($items[$i]['show_attribute'], 2); + } + // Increment counter + $i++; +} + + + +// SHOW TITLE AND MESSAGES IF ANY +// ****************************** + +// Assign page filename for tracking with Google Analytics _trackPageview() function +global $ga_page; +$ga_page = '/view_cart.php'; + +// Show cart title using template file +$tpl->set_file('cart_title', 'title.htm'); +$tpl->set_var(array( + 'TXT_CART' => $MOD_BAKERY['TXT_CART'] +)); +$tpl->pparse('output', 'cart_title'); + +// If enabled show cart success message using template file +if (isset($cart_success)) { + $tpl->set_file('cart_success', 'success.htm'); + $tpl->set_var(array( + 'TXT_UPDATE_CART_SUCCESS' => $MOD_BAKERY['TXT_UPDATE_CART_SUCCESS'] + )); + $tpl->pparse('output', 'cart_success'); +} + +// Compose the cart error messages +if (isset($cart_error) && is_array($cart_error)) { + $message = ''; + foreach ($cart_error as $value) { + $message .= "

".$value."

"; + } + // Show cart error messages using template file + $tpl->set_file('cart_error', 'error.htm'); + $tpl->set_var(array( + 'MESSAGE' => $message, + 'TXT_CONTINUE_SHOPPING' => $MOD_BAKERY['TXT_CONTINUE_SHOPPING'] + )); + $tpl->pparse('output', 'cart_error'); +} + + + +// SHOW CART TABLE +// *************** + +// Determine shipping sum of all items specified +for ($i = 1; $i <= sizeof($items); $i++) { + $shipping_sum[] = $items[$i]['shipping']; +} +$shipping_sum = array_sum($shipping_sum); + +// With shipping per item +if ($shipping_sum > 0) { + $display_shipping = ''; + $colspan_l = 7; + $colspan_m = 6; +} +// No shipping per item +else { + $display_shipping = "none"; + $colspan_l = 6; + $colspan_m = 5; +} + +// Show cart table header using template file +$tpl->set_file('cart_table_header', 'table_header.htm'); +$tpl->set_var(array( + 'TXT_ORDER_ID' => $MOD_BAKERY['TXT_ORDER_ID'], + 'ORDER_ID' => $order_id, + 'SETTING_CONTINUE_URL' => $setting_continue_url, + 'TXT_SKU' => $MOD_BAKERY['TXT_SKU'], + 'TXT_NAME' => $MOD_BAKERY['TXT_NAME'], + 'TXT_QUANTITY' => $MOD_BAKERY['TXT_QUANTITY'], + 'TXT_PRICE' => $MOD_BAKERY['TXT_PRICE'], + 'SETTING_SHOP_CURRENCY' => $setting_shop_currency, + 'DISPLAY_SHIPPING' => $display_shipping, + 'TXT_SHIPPING' => $MOD_BAKERY['TXT_SHIPPING'], + 'TXT_SUM' => $MOD_BAKERY['TXT_SUM'], + 'COLSPAN_L' => $colspan_l +)); +$tpl->pparse('output', 'cart_table_header'); + + +// Loop through items +$order_total = 0; +for ($i = 1; $i <= sizeof($items); $i++) { + + // Calculate order total with shipping per item + if ($shipping_sum > 0) { + $f_price = number_format($items[$i]['price'], 2, $setting_dec_point, $setting_thousands_sep); + $f_shipping = number_format($items[$i]['shipping'], 2, $setting_dec_point, $setting_thousands_sep); + // See http://www.bakery-shop.ch/#shipping_total + // $total = $items[$i]['quantity'] * ($items[$i]['price'] + $items[$i]['shipping']); + $total = $items[$i]['quantity'] * $items[$i]['price']; + $f_total = number_format($total, 2, $setting_dec_point, $setting_thousands_sep); + $order_total = $order_total + $total; + $f_order_total = number_format($order_total, 2, $setting_dec_point, $setting_thousands_sep); + } + // Calculate order total without shipping per item + else { + $f_price = number_format($items[$i]['price'], 2, $setting_dec_point, $setting_thousands_sep); + $f_shipping = 0; + $total = $items[$i]['quantity'] * $items[$i]['price']; + $f_total = number_format($total, 2, $setting_dec_point, $setting_thousands_sep); + $order_total = $order_total + $total; + $f_order_total = number_format($order_total, 2, $setting_dec_point, $setting_thousands_sep); + } + + // Show cart table body using template file + $tpl->set_file('cart_table_body', 'table_body.htm'); + $tpl->set_var(array( + 'THUMB_URL' => $items[$i]['thumb_url'], + 'THUMB_WIDTH' => $items[$i]['thumb_width'], + 'THUMB_HEIGHT' => $items[$i]['thumb_height'], + 'LINK' => $items[$i]['link'], + 'SKU' => $items[$i]['sku'], + 'NAME' => $items[$i]['name'], + 'ATTRIBUTE' => $items[$i]['show_attribute'], + 'ITEM_ID' => $items[$i]['item_id'], + 'ATTRIBUTES' => $items[$i]['attributes'], + 'QUANTITY' => $items[$i]['quantity'], + 'WB_URL' => WB_URL, + 'TEXT_DELETE' => $TEXT['DELETE'], + 'PRICE' => $f_price, + 'DISPLAY_SHIPPING' => $display_shipping, + 'SHIPPING' => $f_shipping, + 'TOTAL' => $f_total + )); + $tpl->pparse('output', 'cart_table_body'); +} + + +// Show order total and buttons using template file +$tpl->set_file('cart_table_footer', 'table_footer.htm'); +$tpl->set_var(array( + 'COLSPAN_L' => $colspan_l, + 'COLSPAN_M' => $colspan_m, + 'TXT_SUM' => $MOD_BAKERY['TXT_SUM'], + 'SETTING_SHOP_CURRENCY' => $setting_shop_currency, + 'ORDER_TOTAL' => $f_order_total, + 'TXT_CONTINUE_SHOPPING' => $MOD_BAKERY['TXT_CONTINUE_SHOPPING'], + 'TXT_UPDATE_CART' => $MOD_BAKERY['TXT_UPDATE_CART'], + 'TXT_SUBMIT_ORDER' => $MOD_BAKERY['TXT_SUBMIT_ORDER'], + 'ORDER_ID' => $order_id +)); + +$tpl->pparse('output', 'cart_table_footer'); diff --git a/view_confirmation.php b/view_confirmation.php new file mode 100644 index 0000000..ca2f834 --- /dev/null +++ b/view_confirmation.php @@ -0,0 +1,251 @@ +set_unknowns('remove'); +// Define debug mode (0:=disabled (default), 1:=variable assignments, 2:=calls to get variable, 4:=debug internals) +$tpl->debug = 0; + + +// Check if payment status and payment method is set +if (is_string($payment_status) && is_string($payment_method)) { + + // Look for payment method language file + if (LANGUAGE_LOADED) { + include(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/languages/EN.php'); + if (file_exists(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/languages/'.LANGUAGE.'.php')) { + include(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/languages/'.LANGUAGE.'.php'); + } + } + + + + // ERROR + // ***** + + if ($payment_status == "error") { + + // Show error message using template file + $tpl->set_file('error', 'error.htm'); + $tpl->set_var(array( + 'ERROR' => $MOD_BAKERY[$payment_method]['ERROR'], + 'SETTING_CONTINUE_URL' => $setting_continue_url, + 'TXT_CONTINUE_SHOPPING' => $MOD_BAKERY['TXT_CONTINUE_SHOPPING'], + 'TXT_CANCEL_ORDER' => $MOD_BAKERY['TXT_CANCEL_ORDER'], + 'TXT_JS_CONFIRM' => $MOD_BAKERY['TXT_JS_CONFIRM'] + )); + $tpl->pparse('output', 'error'); + return; + } + + + + // CANCELED + // ******** + + if ($payment_status == "canceled") { + + // Show message using template file + $tpl->set_file('canceled', 'canceled.htm'); + $tpl->set_var(array( + 'CANCELED' => $MOD_BAKERY[$payment_method]['CANCELED'], + 'SETTING_CONTINUE_URL' => $setting_continue_url, + 'TXT_CONTINUE_SHOPPING' => $MOD_BAKERY['TXT_CONTINUE_SHOPPING'], + 'TXT_CANCEL_ORDER' => $MOD_BAKERY['TXT_CANCEL_ORDER'], + 'TXT_JS_CONFIRM' => $MOD_BAKERY['TXT_JS_CONFIRM'] + )); + $tpl->pparse('output', 'canceled'); + return; + } + + + + // SUCCESS OR PENDING + // ****************** + + if ($payment_status == "success" || $payment_status == "pending") { + + // Get the order id from the session var or, + // in case this script has been called by a payment method directly (eg. paypal ipn), + // use the one provided by the payment gateway + $order_id = isset($order_id) && is_numeric($order_id) ? $order_id : $_SESSION['bakery']['order_id']; + + // Initialize var + $email_sent = 2; + + // UPDATE DB + + // Check if we have to update db and send emails + $query_customers = $database->query("SELECT submitted FROM ".TABLE_PREFIX."mod_bakery_customer WHERE order_id = '$order_id' AND submitted = 'no' AND status = 'none'"); + + if ($query_customers->numRows() == 1) { + + // Reset email sent to 0 + $email_sent = 0; + + // Consecutive numbering of invoice numbers + $new_invoice_id = $database->get_one("SELECT MAX(`invoice_id`) + 1 AS new_invoice_id FROM ".TABLE_PREFIX."mod_bakery_customer"); + // Update db + $database->query("UPDATE ".TABLE_PREFIX."mod_bakery_customer SET submitted = '$payment_method', status = 'ordered', invoice_id = '$new_invoice_id' WHERE order_id = '$order_id'"); + + + // SEND CONFIRMATION EMAILS + + // Get the email templates from the db + $query_payment_methods = $database->query("SELECT cust_email_subject, cust_email_body, shop_email_subject, shop_email_body FROM ".TABLE_PREFIX."mod_bakery_payment_methods WHERE directory = '$payment_method'"); + if ($query_payment_methods->numRows() > 0) { + $payment_methods = $query_payment_methods->fetchRow(); + $cust_email_subject = stripslashes($payment_methods['cust_email_subject']); + $cust_email_body = stripslashes($payment_methods['cust_email_body']); + $shop_email_subject = stripslashes($payment_methods['shop_email_subject']); + $shop_email_body = stripslashes($payment_methods['shop_email_body']); + } + + // Get email data string from db customer table + $query_customer = $database->query("SELECT invoice FROM ".TABLE_PREFIX."mod_bakery_customer WHERE order_id = '$order_id'"); + if ($query_customer->numRows() > 0) { + $customer = $query_customer->fetchRow(); + if ($customer['invoice'] != '') { + // Convert string to array + $invoice = stripslashes($customer['invoice']); + $invoice_array = explode('&&&&&', $invoice); + + // Email vars to replace placeholders in the email body + $setting_shop_name = $invoice_array[1]; + $bank_account = $invoice_array[2]; + $cust_name = $invoice_array[3]; + $cust_email = $invoice_array[7]; + $shop_email = $invoice_array[10]; + $address = $invoice_array[11]; + $cust_address = $invoice_array[12]; + $ship_address = $invoice_array[13]; + $item_list = $invoice_array[14]; + $cust_tax_no = $invoice_array[15]; + $cust_msg = $invoice_array[16]; + } + } + + // In case this script has been called by a payment method directly (eg. paypal ipn) + // we have to add the shop email var + $setting_shop_email = isset($setting_shop_email) ? $setting_shop_email : $shop_email; + + // Remove all "\r" in emails to avoid double line breaks + $cust_email_subject = str_replace ("\r", '', $cust_email_subject); + $cust_email_body = str_replace ("\r", '', $cust_email_body); + $shop_email_subject = str_replace ("\r", '', $shop_email_subject); + $shop_email_body = str_replace ("\r", '', $shop_email_body); + + // Make email headers + if (defined('DEFAULT_CHARSET')) { $charset = DEFAULT_CHARSET; } else { $charset = 'utf-8'; } + $headers = "MIME-Version: 1.0"."\n"; + $headers .= "Content-type: text/plain; charset=\"$charset\""."\n"; + + $cust_email_headers = $headers."Return-Path: $setting_shop_email"."\n"; + $cust_email_headers .= "Reply-To: $setting_shop_email"."\n"; + $cust_email_headers .= "From: $setting_shop_name <$setting_shop_email>"; + + $shop_email_headers = $headers."Return-Path: $setting_shop_email"."\n"; + $shop_email_headers .= "Reply-To: $cust_email"."\n"; + $shop_email_headers .= "From: $setting_shop_name <$setting_shop_email>"; + + // Make transaction status notice + $transaction_status_notice = ''; + if ($payment_status == 'pending' && isset($MOD_BAKERY[$payment_method]['TXT_TRANSACTION_STATUS'])) { + $transaction_status_notice = $MOD_BAKERY[$payment_method]['TXT_TRANSACTION_STATUS']; + } + + // If customer has not sent a message then display 'none' + $cust_msg = empty($cust_msg) ? "\t".$TEXT['NONE'] : $cust_msg; + + // Replace placeholders by values in the email body + $vars = array('[ORDER_ID]', '[SHOP_NAME]', '[BANK_ACCOUNT]', '[TRANSACTION_STATUS]', '[CUSTOMER_NAME]', '[ADDRESS]', '[CUST_ADDRESS]', '[SHIPPING_ADDRESS]', '[CUST_EMAIL]', '[ITEM_LIST]', '[CUST_TAX_NO]', '[CUST_MSG]'); + $values = array($order_id, $setting_shop_name, $bank_account, $transaction_status_notice, $cust_name, $address, $cust_address, $ship_address, $cust_email, $item_list, $cust_tax_no, $cust_msg); + + $cust_email_subject = str_replace($vars, $values, $cust_email_subject); + $shop_email_subject = str_replace($vars, $values, $shop_email_subject); + $cust_email_body = str_replace($vars, $values, $cust_email_body); + $shop_email_body = str_replace($vars, $values, $shop_email_body); + + // Send confirmation e-mail to customer and shop + // Increment email counter + if (mail($cust_email, $cust_email_subject, $cust_email_body, $cust_email_headers)) { + $email_sent++; + } + if (mail($setting_shop_email, $shop_email_subject, $shop_email_body, $shop_email_headers)) { + $email_sent++; + } + } + + + // WEBSITE CONFIRMATION + + // In case payment data has been transfered in the background (eg. paypal ipn) + // there is no way to show a confirmation page to the customer + if (!isset($no_confirmation)) { + + // Show confirmation using template file + if ($payment_status == "success") { + $tpl->set_file('success', 'success.htm'); + $tpl->set_var(array( + 'TXT_SUCCESS' => $MOD_BAKERY[$payment_method]['TXT_SUCCESS'], + 'TXT_SHIPMENT' => $MOD_BAKERY[$payment_method]['TXT_SHIPMENT'], + 'TXT_THANK_U_ORDER' => $MOD_BAKERY['TXT_THANK_U_ORDER'] + )); + $tpl->pparse('output', 'success'); + } + elseif ($payment_status == "pending") { + $tpl->set_file('pending', 'pending.htm'); + $tpl->set_var(array( + 'TXT_PENDING' => $MOD_BAKERY[$payment_method]['TXT_PENDING'], + 'TXT_SHIPMENT' => $MOD_BAKERY[$payment_method]['TXT_SHIPMENT'], + 'TXT_THANK_U_ORDER' => $MOD_BAKERY['TXT_THANK_U_ORDER'] + )); + $tpl->pparse('output', 'pending'); + } + + // If emails have not been sent show additional email error using template file + if ($email_sent < 2) { + $shop_email_link = '' . $setting_shop_email . ''; + $tpl->set_file('email_error', 'email_error.htm'); + $tpl->set_var(array( + 'ERR_EMAIL_NOT_SENT' => $MOD_BAKERY['ERR_EMAIL_NOT_SENT'] . ':
' . $shop_email_link + )); + $tpl->pparse('output', 'email_error'); + } + } + + // Clean up the session array + if (isset($_SESSION['bakery'])) { + unset($_SESSION['bakery']); + } + return; + } +} else { + echo 'ERROR: Payment status or payment method is not defined.'; + return; +} diff --git a/view_form.php b/view_form.php new file mode 100644 index 0000000..b98eea1 --- /dev/null +++ b/view_form.php @@ -0,0 +1,479 @@ +set_unknowns('remove'); +// Define debug mode (0:=disabled (default), 1:=variable assignments, 2:=calls to get variable, 4:=debug internals) +$tpl->debug = 0; + +// Include country file depending on the language +if (LANGUAGE_LOADED) { + if (file_exists(WB_PATH.'/modules/bakery/languages/countries/'.LANGUAGE.'.php')) { + require_once(WB_PATH.'/modules/bakery/languages/countries/'.LANGUAGE.'.php'); + } +} +else { + require_once(WB_PATH.'/modules/bakery/languages/countries/EN.php'); +} + +// Include state file depending on the shop country +$select_shop_country = ''; +$use_states = false; +if (file_exists(WB_PATH.'/modules/bakery/languages/states/'.$setting_shop_country.'.php')) { + require_once(WB_PATH.'/modules/bakery/languages/states/'.$setting_shop_country.'.php'); + $select_shop_country = $setting_shop_country; + $use_states = true; +} + + + +// GET CUSTOMER DATA TO PREPOPULATE THE TEXT FIELDS +// ************************************************ + +// Arrays for all forms and fields +$forms = array('cust', 'ship'); +$fields = array('company', 'first_name', 'last_name', 'tax_no', 'street', 'city', 'state', 'country', 'zip', 'email', 'confirm_email', 'phone'); + +// Get customer data and use session var to store it +foreach ($forms as $form) { + foreach ($fields as $field) { + $field_var = $form.'_'.$field; + // Set session var with customer data if not set yet + if (!isset($_SESSION['bakery'][$form][$field])) $_SESSION['bakery'][$form][$field] = ''; + if (!empty($_POST[$field_var])) $_SESSION['bakery'][$form][$field] = strip_tags($_POST[$field_var]); + // Make vars like $cust_company, $cust_first_name,... and $ship_company, $ship_first_name,... + $$field_var = $_SESSION['bakery'][$form][$field]; + } +} + + +// For logged in user try to get customer data of a previous order from the db... +if (isset($_SESSION['USER_ID']) && $cust_first_name == '' && $cust_last_name == '' && $cust_street == '' && $cust_city == '' && $cust_state == '' && $cust_zip == '' && $cust_email == '' && $cust_phone == '') { + $sql_result = $database->query("SELECT cust_company, cust_first_name, cust_last_name, cust_tax_no, cust_street, cust_city, cust_state, cust_country, cust_zip, cust_email, cust_phone FROM " .TABLE_PREFIX."mod_bakery_customer WHERE user_id = '{$_SESSION['USER_ID']}' ORDER BY order_id DESC LIMIT 1"); + $n = $sql_result->numRows(); + if ($n > 0) { + $row = $sql_result->fetchRow(); + extract($row); + $cust_confirm_email = $cust_email; + } +} + +// ...and same for the shipping data +if (isset($_SESSION['USER_ID']) && $ship_first_name == '' && $ship_last_name == '' && $ship_street == '' && $ship_city == '' && $ship_state == '' && $ship_zip == '') { + $sql_result = $database->query("SELECT ship_company, ship_first_name, ship_last_name, ship_street, ship_city, ship_state, ship_country, ship_zip FROM " .TABLE_PREFIX."mod_bakery_customer WHERE user_id = '{$_SESSION['USER_ID']}' ORDER BY order_id DESC LIMIT 1"); + $n = $sql_result->numRows(); + if ($n > 0) { + $row = $sql_result->fetchRow(); + extract($row); + } +} + + +// If no country has been selected, preselect the shop country +if (!isset($cust_country) || $cust_country == '') { + $cust_country = $setting_shop_country; +} +if ((!isset($ship_country) || $ship_country == '') && $setting_shipping_form != 'none') { + $ship_country = $setting_shop_country; +} +// If no state is selected, preselect the shop state +if (!isset($cust_state) || $cust_state == '') { + $cust_state = $setting_shop_state; +} +if ((!isset($ship_state) || $ship_state == '') && $setting_shipping_form != 'none') { + $ship_state = $setting_shop_state; +} + + + +// SHOW TITLE AND MESSAGES IF ANY +// ****************************** + +// Assign page filename for tracking with Google Analytics _trackPageview() function +global $ga_page; +$ga_page = '/view_form.php'; + +// Show form title using template file +$tpl->set_file('form_title', 'title.htm'); +$tpl->set_var(array( + 'WB_URL' => WB_URL, + 'TXT_SUBMIT_ORDER' => $MOD_BAKERY['TXT_SUBMIT_ORDER'], + 'TXT_ADDRESS' => $MOD_BAKERY['TXT_ADDRESS'], + 'TXT_FILL_IN_ADDRESS' => $MOD_BAKERY['TXT_FILL_IN_ADDRESS'], + 'SETTING_CONTINUE_URL' => $setting_continue_url +)); +$tpl->pparse('output', 'form_title'); + +// Show form error messages using template file +if (isset($form_error)) { + $tpl->set_file('form_error', 'error.htm'); + $tpl->set_var(array( + 'FORM_ERROR' => $form_error + )); + $tpl->pparse('output', 'form_error'); +} + + + +// SET FILE AND BLOCKS FOR FORM TEMPLATE +// ************************************* + +$tpl->set_file('form', 'form.htm'); + +$tpl->set_block('form', 'main_block', 'main'); + +$tpl->set_block('main_block', 'cust_country_block', 'cust_country'); +$tpl->set_block('main_block', 'cust_state_block', 'cust_state'); +$tpl->set_block('main_block', 'cust_textfields_block', 'cust_textfields'); +$tpl->set_block('main_block', 'cust_button_block', 'cust_button'); +$tpl->set_block('main_block', 'cust_buttons_block', 'cust_buttons'); + +$tpl->set_block('main_block', 'ship_title_block', 'ship_title'); +$tpl->set_block('main_block', 'ship_country_block', 'ship_country'); +$tpl->set_block('main_block', 'ship_state_block', 'ship_state'); +$tpl->set_block('main_block', 'ship_textfields_block', 'ship_textfields'); +$tpl->set_block('main_block', 'ship_button_block', 'ship_button'); +$tpl->set_block('main_block', 'ship_buttons_block', 'ship_buttons'); + + + +// CUSTOMER ADDRESS FORM ONLY +// ************************** + +// Concatenate tax no and optional +$MOD_BAKERY['TXT_CUST_TAX_NO'] = $MOD_BAKERY['TXT_CUST_TAX_NO'] . ' (' . $MOD_BAKERY['TXT_OPTIONAL'] . ')'; + +// Make array for the customer address form +if ($setting_zip_location == "end") { + // Show zip at the end of address + $cust_info = array("cust_email" => $MOD_BAKERY['TXT_CUST_EMAIL'], "cust_confirm_email" => $MOD_BAKERY['TXT_CUST_CONFIRM_EMAIL'], "cust_company" => $MOD_BAKERY['TXT_CUST_COMPANY'], "cust_first_name" => $MOD_BAKERY['TXT_CUST_FIRST_NAME'], "cust_last_name" => $MOD_BAKERY['TXT_CUST_LAST_NAME'], "cust_tax_no" => $MOD_BAKERY['TXT_CUST_TAX_NO'], "cust_street" => $MOD_BAKERY['TXT_CUST_ADDRESS'], "cust_city" => $MOD_BAKERY['TXT_CUST_CITY'], "cust_state" => $MOD_BAKERY['TXT_CUST_STATE'], "cust_zip" => $MOD_BAKERY['TXT_CUST_ZIP'], "cust_country" => $MOD_BAKERY['TXT_CUST_COUNTRY'], "cust_phone" => $MOD_BAKERY['TXT_CUST_PHONE']); + $length = array("cust_email" => "50", "cust_confirm_email" => "50", "cust_company" => "50", "cust_first_name" => "50", "cust_last_name" => "50", "cust_tax_no" => "20", "cust_street" => "50", "cust_zip" => "10", "cust_city" => "50", "cust_state" => "50", "cust_phone" => "20"); +} else { + // Show zip inside of address + $cust_info = array("cust_email" => $MOD_BAKERY['TXT_CUST_EMAIL'], "cust_confirm_email" => $MOD_BAKERY['TXT_CUST_CONFIRM_EMAIL'], "cust_company" => $MOD_BAKERY['TXT_CUST_COMPANY'], "cust_first_name" => $MOD_BAKERY['TXT_CUST_FIRST_NAME'], "cust_last_name" => $MOD_BAKERY['TXT_CUST_LAST_NAME'], "cust_tax_no" => $MOD_BAKERY['TXT_CUST_TAX_NO'], "cust_street" => $MOD_BAKERY['TXT_CUST_ADDRESS'], "cust_zip" => $MOD_BAKERY['TXT_CUST_ZIP'], "cust_city" => $MOD_BAKERY['TXT_CUST_CITY'], "cust_state" => $MOD_BAKERY['TXT_CUST_STATE'], "cust_country" => $MOD_BAKERY['TXT_CUST_COUNTRY'], "cust_phone" => $MOD_BAKERY['TXT_CUST_PHONE']); + $length = array("cust_email" => "50", "cust_confirm_email" => "50", "cust_company" => "50", "cust_first_name" => "50", "cust_last_name" => "50", "cust_tax_no" => "20", "cust_street" => "50", "cust_zip" => "10", "cust_city" => "50", "cust_state" => "50", "cust_phone" => "20"); +} + +// Delete field customer company if not needed +if ($setting_company_field != "show") { + unset($cust_info['cust_company']); + unset($length['cust_company']); +} + +// Delete field customer state if not needed +if ($setting_state_field != "show") { + unset($cust_info['cust_state']); + unset($length['cust_state']); +} + +// Delete field customer tax number if not needed +if ($setting_tax_no_field != "show") { + unset($cust_info['cust_tax_no']); + unset($length['cust_tax_no']); +} + +// Initialize vars +$country_options = ''; +$state_options = ''; + +// Loop through all fields and generate the form +foreach ($cust_info as $field => $value) { + + // Generate country dropdown menu... + if ($field == "cust_country") { + // Prepare cust country options + for ($n = 1; $n <= count($MOD_BAKERY['TXT_COUNTRY_NAME']); $n++) { + $country = $MOD_BAKERY['TXT_COUNTRY_NAME'][$n]; + $country_code = $MOD_BAKERY['TXT_COUNTRY_CODE'][$n]; + $selected_country = ($country_code == @$_POST['country'] || $country_code == @$cust_country) ? ' selected="selected"' : ''; + $country_options .= "\n\t\t\t"; + } + // Show cust country block using template file + $tpl->set_var(array( + 'TXT_CUST_COUNTRY' => $MOD_BAKERY['TXT_CUST_COUNTRY'], + 'SELECT_SHOP_COUNTRY' => $select_shop_country, + 'COUNTRY_OPTIONS' => $country_options + )); + $tpl->parse('form', 'cust_country_block', true); + } + + else { + // Generate state dropdown menu... + if ($use_states && $field == "cust_state") { + // Prepare cust state options + for ($n = 1; $n <= count($MOD_BAKERY['TXT_STATE_NAME']); $n++) { + $state = $MOD_BAKERY['TXT_STATE_NAME'][$n]; + $state_code = $MOD_BAKERY['TXT_STATE_CODE'][$n]; + $selected_state = ($state_code == @$_POST['cust_state'] || $state_code == @$cust_state) ? ' selected="selected"' : ''; + $state_options .= "\n\t\t\t"; + } + // Show cust state options block using template file + $tpl->set_var(array( + 'TXT_CUST_STATE' => $MOD_BAKERY['TXT_CUST_STATE'], + 'STATE_OPTIONS' => $state_options + )); + $tpl->parse('form', 'cust_state_block', true); + } + + // Generate all other fields + // Add css class (red background) if the textfield is blank or incorrect + $css_error_class = isset($error_bg) && in_array($field, $error_bg) ? 'mod_bakery_errorbg_f ' : ''; + // Show cust textfields block using template file + $tpl->set_var(array( + 'TR_ID' => $field."_text", + 'LABEL' => $value, + 'CSS_ERROR_CLASS' => $css_error_class, + 'NAME' => $field, + 'VALUE' => htmlspecialchars(@$$field, ENT_QUOTES), + 'MAXLENGTH' => $length[$field] + )); + $tpl->parse('form', 'cust_textfields_block', true); + } +} + + + +// CHECK IF WE HAVE TO SHOW THE SHIP FORM +// ************************************** + +// Initialize session var ship_form depending on general settings +if (!isset($_SESSION['bakery']['ship_form'])) { + $_SESSION['bakery']['ship_form'] = null; + if ($setting_shipping_form == 'request') { + $_SESSION['bakery']['ship_form'] = false; + } elseif ($setting_shipping_form == 'hideable') { + $_SESSION['bakery']['ship_form'] = true; + } +} + +// Toogle session var depending on address form buttons "add" or "hide ship form" +if (!empty($_POST['add_ship_form'])) { + $_SESSION['bakery']['ship_form'] = true; +} elseif (!empty($_POST['hide_ship_form'])) { + $_SESSION['bakery']['ship_form'] = false; +} + +// Check if we have to show ship form +$show_ship_form = false; +if ($setting_shipping_form != 'none') { + if ($setting_shipping_form == 'request' && $_SESSION['bakery']['ship_form']) { + $show_ship_form = true; + } + if ($setting_shipping_form == 'hideable' && $_SESSION['bakery']['ship_form']) { + $show_ship_form = true; + } + if ($setting_shipping_form == 'always') { + $show_ship_form = true; + } +} + +// Show the submit button (without shipping address form)... +if ($setting_shipping_form == 'none') { + $tpl->set_var(array( + 'TXT_SELECT_PAYMENT_METHOD' => $MOD_BAKERY['TXT_SELECT_PAYMENT_METHOD'] + )); + $tpl->parse('form', 'cust_button_block', true); +} +// ...or show a button to add the shipping address form and the submit button (without shipping address form) +elseif (($setting_shipping_form == 'request' || $setting_shipping_form == 'hideable') && !$_SESSION['bakery']['ship_form']) { + $tpl->set_var(array( + 'TXT_ADD_SHIP_FORM' => $MOD_BAKERY['TXT_ADD_SHIP_FORM'], + 'TXT_SELECT_PAYMENT_METHOD' => $MOD_BAKERY['TXT_SELECT_PAYMENT_METHOD'] + )); + $tpl->parse('form', 'cust_buttons_block', true); +} + + + +// ADD SHIPPING ADDRESS FORM IF REQUIRED +// ************************************* + +if ($show_ship_form) { + + $_SESSION['bakery']['ship_data'] = true; + + // Make array for the shipping address form + if ($setting_zip_location == "end") { + // Show zip at the end of address + $ship_info = array("ship_company" => $MOD_BAKERY['TXT_CUST_COMPANY'], "ship_first_name" => $MOD_BAKERY['TXT_CUST_FIRST_NAME'], "ship_last_name" => $MOD_BAKERY['TXT_CUST_LAST_NAME'], "ship_street" => $MOD_BAKERY['TXT_CUST_ADDRESS'], "ship_city" => $MOD_BAKERY['TXT_CUST_CITY'], "ship_state" => $MOD_BAKERY['TXT_CUST_STATE'], "ship_zip" => $MOD_BAKERY['TXT_CUST_ZIP'], "ship_country" => $MOD_BAKERY['TXT_CUST_COUNTRY']); + $length = array("ship_company" => "50", "ship_first_name" => "50", "ship_last_name" => "50", "ship_street" => "50", "ship_zip" => "10", "ship_city" => "50", "ship_state" => "50"); + } else { + // Show zip inside of address + $ship_info = array("ship_company" => $MOD_BAKERY['TXT_CUST_COMPANY'], "ship_first_name" => $MOD_BAKERY['TXT_CUST_FIRST_NAME'], "ship_last_name" => $MOD_BAKERY['TXT_CUST_LAST_NAME'], "ship_street" => $MOD_BAKERY['TXT_CUST_ADDRESS'], "ship_zip" => $MOD_BAKERY['TXT_CUST_ZIP'], "ship_city" => $MOD_BAKERY['TXT_CUST_CITY'], "ship_state" => $MOD_BAKERY['TXT_CUST_STATE'], "ship_country" => $MOD_BAKERY['TXT_CUST_COUNTRY']); + $length = array("ship_company" => "50", "ship_first_name" => "50", "ship_last_name" => "50", "ship_street" => "50", "ship_zip" => "10", "ship_city" => "50", "ship_state" => "50"); + } + + // Delete field shipping company if not needed + if ($setting_company_field != "show") { + unset($ship_info['ship_company']); + unset($length['ship_company']); + } + + // Delete field shipping state if not needed + if ($setting_state_field != "show") { + unset($ship_info['ship_state']); + unset($length['ship_state']); + } + + // Show ship form title using template file + $tpl->set_var(array( + 'TXT_FILL_IN_SHIP_ADDRESS' => $MOD_BAKERY['TXT_FILL_IN_SHIP_ADDRESS'] + )); + $tpl->parse('form', 'ship_title_block', true); + + + // Initialize vars + $country_options = ''; + $state_options = ''; + + // Loop through all fields and generate the shipping address form + foreach ($ship_info as $field => $value) { + + // Generate country dropdown menu... + if ($field == "ship_country") { + // Prepare ship country options + for ($n = 1; $n <= count($MOD_BAKERY['TXT_COUNTRY_NAME']); $n++) { + $country = $MOD_BAKERY['TXT_COUNTRY_NAME'][$n]; + $country_code = $MOD_BAKERY['TXT_COUNTRY_CODE'][$n]; + $selected_country = ($country_code == @$_POST['country'] || $country_code == @$ship_country) ? ' selected="selected"' : ''; + $country_options .= "\n\t\t\t"; + } + // Show ship country block using template file + $tpl->set_var(array( + 'TXT_CUST_COUNTRY' => $MOD_BAKERY['TXT_CUST_COUNTRY'], + 'SELECT_SHOP_COUNTRY' => $select_shop_country, + 'COUNTRY_OPTIONS' => $country_options + )); + $tpl->parse('form', 'ship_country_block', true); + } + + else { + // Generate state dropdown menu... + if ($use_states && $field == "ship_state") { + // Prepare cust state options + for ($n = 1; $n <= count($MOD_BAKERY['TXT_STATE_NAME']); $n++) { + $state = $MOD_BAKERY['TXT_STATE_NAME'][$n]; + $state_code = $MOD_BAKERY['TXT_STATE_CODE'][$n]; + $selected_state = ($state_code == @$_POST['cust_state'] || $state_code == @$ship_state) ? ' selected="selected"' : ''; + $state_options .= "\n\t\t\t"; + } + // Show cust state options block using template file + $tpl->set_var(array( + 'TXT_CUST_STATE' => $MOD_BAKERY['TXT_CUST_STATE'], + 'STATE_OPTIONS' => $state_options + )); + $tpl->parse('form', 'ship_state_block', true); + } + + + // Generate all other fields + // Add css class (red background) if the textfield is blank or incorrect + $css_error_class = isset($error_bg) && in_array($field, $error_bg) ? 'mod_bakery_errorbg_f ' : ''; + // Show ship textfields block using template file + $tpl->set_var(array( + 'TR_ID' => $field."_text", + 'LABEL' => $value, + 'CSS_ERROR_CLASS' => $css_error_class, + 'NAME' => $field, + 'VALUE' => htmlspecialchars(@$$field, ENT_QUOTES), + 'MAXLENGTH' => $length[$field] + )); + $tpl->parse('form', 'ship_textfields_block', true); + } + } + + // Show the submit button and a button to hide the shipping address form at the bottom of the form... + if ($setting_shipping_form == "request" || $setting_shipping_form == "hideable") { + $tpl->set_var(array( + 'TXT_HIDE_SHIP_FORM' => $MOD_BAKERY['TXT_HIDE_SHIP_FORM'], + 'TXT_SELECT_PAYMENT_METHOD' => $MOD_BAKERY['TXT_SELECT_PAYMENT_METHOD'] + )); + $tpl->parse('form', 'ship_buttons_block', true); + } + // ...or show the submit button + elseif ($setting_shipping_form == 'always') { + $tpl->set_var(array( + 'TXT_SELECT_PAYMENT_METHOD' => $MOD_BAKERY['TXT_SELECT_PAYMENT_METHOD'] + )); + $tpl->parse('form', 'ship_button_block', true); + } +} + +// Delete ship data if ship form has not been completed +else { + unset($_SESSION['bakery']['ship']); + $_SESSION['bakery']['ship_data'] = false; +} + + +// PARSE FORM TEMPLATE +// ******************* + +$tpl->parse('form', 'main_block', true); +$tpl->pparse('output', 'form'); + +// Initialize js to toggle customer/shipping state text field/select list +if ($_SESSION['bakery']['ship_form']) { + echo " + "; +} else { + echo " + "; +} + +// Code below is deprecated and stoped droplets working (only used for WB < 2.8.1) +if (version_compare(WB_VERSION, '2.8.1') < 0) { + + // Obtain the settings of the output filter module + if (file_exists(WB_PATH.'/modules/output_filter/filter-routines.php')) { + include_once(WB_PATH.'/modules/output_filter/filter-routines.php'); + if (function_exists('getOutputFilterSettings')) { + $filter_settings = getOutputFilterSettings(); + } else { + $filter_settings = get_output_filter_settings(); + } + } else { + // No output filter used, define default settings + $filter_settings['email_filter'] = 0; + } + + // NOTE: + // With ob_end_flush() the output filter will be disabled for Bakery address form page + // If you are using e.g. ob_start in the index.php of your template it is possible that you will indicate problems + if ($filter_settings['email_filter'] && !($filter_settings['at_replacement']=='@' && $filter_settings['dot_replacement']=='.')) { + ob_end_flush(); + } +} diff --git a/view_invoice.php b/view_invoice.php new file mode 100644 index 0000000..09ff40d --- /dev/null +++ b/view_invoice.php @@ -0,0 +1,150 @@ +get_page_permission($page_id, $action='admin') === false) { + // User allowed to view this page + die($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']); +} + + + +// Look for language file +if (LANGUAGE_LOADED) { + require_once(WB_PATH.'/modules/bakery/languages/EN.php'); + if (file_exists(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php')) { + require_once(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php'); + } +} + +// Show invoice, delivery note or reminder +if (isset($_POST['view'])) { + $view = $_POST['view']; +} +else { + $view = 'invoice'; +} + +// Make difference between invoice, delivery note and reminder +$display_reminder = "none"; +$display_delivery_note = "none"; +$display_invoice = "none"; +if ($view == 'reminder') { + $title = $MOD_BAKERY['TXT_REMINDER']; + $display_reminder = ''; +} +elseif ($view == 'delivery_note') { + $title = $MOD_BAKERY['TXT_DELIVERY_NOTE']; + $display_delivery_note = ''; +} +else { + $title = $MOD_BAKERY['TXT_INVOICE']; + $display_invoice = ''; +} + +// Header +?> + + + +<?php echo $MOD_BAKERY['TXT_PRINT']." ".$title; ?> + + + + +query("SELECT value_4 FROM ".TABLE_PREFIX."mod_bakery_payment_methods WHERE directory = 'invoice'"); +if ($query_payment_methods->numRows() > 0) { + $payment_methods = $query_payment_methods->fetchRow(); +} +$invoice_template = stripslashes($payment_methods['value_4']); + +// Get invoice data string from db customer table +$query_customer = $database->query("SELECT invoice_id, invoice FROM ".TABLE_PREFIX."mod_bakery_customer WHERE order_id = '$order_id'"); +if ($query_customer->numRows() > 0) { + $customer = $query_customer->fetchRow(); + + if ($customer['invoice'] != '') { + // Convert string to array + $invoice = stripslashes($customer['invoice']); + $invoice_array = explode("&&&&&", $invoice); + // Chop off phone number and email from customer address + $invoice_address = explode("

", $invoice_array[4]); + $invoice_cust_address = explode("

", $invoice_array[5]); + // If given get customer tax no + $cust_tax_no = !empty($invoice_array[15]) ? $invoice_array[15] : ' — '; + // Change frontend classes (eg. mod_bakery_anything_f) to backend classes (eg. mod_bakery_anything_b) + $invoice_array[8] = str_replace("_f'", "_b'", $invoice_array[8]); + // Current date + $today = @date(DEFAULT_DATE_FORMAT); + // Invoice id + $invoice_id = $customer['invoice_id']; + + // Replace invoice placeholders by values + $vars = array('[WB_URL]', '[ORDER_ID]', '[INVOICE_ID]', '[SHOP_NAME]', '[BANK_ACCOUNT]', '[CUSTOMER_NAME]', '[ADDRESS]', '[CUST_ADDRESS]', '[SHIPPING_ADDRESS]', '[CUST_EMAIL]', '[ITEM_LIST]', '[ORDER_DATE]', '[CURRENT_DATE]', '[TITLE]', '[DISPLAY_INVOICE]', '[DISPLAY_DELIVERY_NOTE]', '[DISPLAY_REMINDER]', '[CUST_TAX_NO]'); + $values = array(WB_URL, $invoice_array[0], $invoice_id, $invoice_array[1], nl2br($invoice_array[2]), $invoice_array[3], $invoice_address[0], $invoice_cust_address[0], $invoice_array[6], $invoice_array[7], $invoice_array[8], $invoice_array[9], $today, $title, $display_invoice, $display_delivery_note, $display_reminder, $cust_tax_no); + $invoice = str_replace($vars, $values, $invoice_template); + + // Wrap invoice in a
and add an anchor + $invoice = "
\n".$invoice."\n
\n"; + // View invoice + echo $invoice; + } + else { + echo '

'.$TEXT['NONE_FOUND'].'!

'; + } +} + +// Buttons and select document type for printing +?> +
+
+
+
{TXT_SKU}{TXT_NAME}{TXT_QUANTITY}{TXT_PRICE}
+ {SETTING_SHOP_CURRENCY}   
{TXT_SHIPPING}
+ {SETTING_SHOP_CURRENCY}   
{TXT_SUM}
+ {SETTING_SHOP_CURRENCY}   

+ + + + +
+ + +
+ +
+ diff --git a/view_item.php b/view_item.php new file mode 100644 index 0000000..7c45218 --- /dev/null +++ b/view_item.php @@ -0,0 +1,334 @@ + + + + + + + + +query("SELECT link FROM ".TABLE_PREFIX."pages WHERE page_id = '".PAGE_ID."'"); +if ($query_page->numRows() > 0) { + $page = $query_page->fetchRow(); + $page_link = page_link($page['link']); +} else { + exit('Page not found'); +} + +// Get total number of items +$query_total_num = $database->query("SELECT item_id FROM ".TABLE_PREFIX."mod_bakery_items WHERE section_id = '$section_id' AND active = '1' AND title != ''"); +$total_num = $query_total_num->numRows(); + +// Get item info +$query_item = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_items WHERE item_id = '".ITEM_ID."' AND active = '1'"); +if ($query_item->numRows() > 0) { + $item = $query_item->fetchRow(); + $position = $item['position']; + $title = htmlspecialchars(stripslashes($item['title'])); + $price = number_format(stripslashes($item['price']), 2, $setting_dec_point, $setting_thousands_sep); + + // Initialize vars + $next_link = ''; + $previous_link = ''; + + // If number of items is limited on overview pages, + // add saved position as a get parameter to the page link + if ($setting_items_per_page > 0) { + $p = empty($_SESSION['bakery']['position']) ? 0 : $_SESSION['bakery']['position']; + $page_link = page_link($page['link']).'?p='.$p; + } + + // Create previous and next links + $query_surrounding = $database->query("SELECT item_id FROM ".TABLE_PREFIX."mod_bakery_items WHERE position != '$position' AND section_id = '$section_id' AND active = '1' LIMIT 1"); + if ($query_surrounding->numRows() > 0) { + // Get previous + if ($position > 1) { + $query_previous = $database->query("SELECT title, link FROM ".TABLE_PREFIX."mod_bakery_items WHERE position < '$position' AND section_id = '$section_id' AND active = '1' ORDER BY position DESC LIMIT 1"); + if ($query_previous->numRows() > 0) { + $previous = $query_previous->fetchRow(); + // Truncate text and add horizontal ellipsis + if (strlen($previous['title']) > $link_length) { + $previous['title'] = substr($previous['title'], 0, $link_length).'…'; + } + $previous_link = '« '.htmlspecialchars(stripslashes($previous['title'])).''; + } + } + // Get next + $query_next = $database->query("SELECT title, link FROM ".TABLE_PREFIX."mod_bakery_items WHERE position > '$position' AND section_id = '$section_id' AND active = '1' ORDER BY position ASC LIMIT 1 "); + if ($query_next->numRows() > 0) { + $next = $query_next->fetchRow(); + // Truncate text and add horizontal ellipsis + if (strlen($next['title']) > $link_length) { + $next['title'] = substr($next['title'], 0, $link_length).'…'; + } + $next_link = ''.htmlspecialchars(stripslashes($next['title'])).' »'; + } + } + + $out_of = $position.' '.strtolower($TEXT['OUT_OF']).' '.$total_num; + $of = $position.' '.strtolower($TEXT['OF']).' '.$total_num; + + // User who last modified the item + $uid = $item['modified_by']; + + // Workout date and time of last modified item + $item_date = gmdate(DATE_FORMAT, $item['modified_when']+TIMEZONE); + $item_time = gmdate(TIME_FORMAT, $item['modified_when']+TIMEZONE); + + + + // Item thumb(s) and image(s) + + // Initialize or reset thumb(s) and image(s) befor laoding next item + $thumb_arr = array(); + $image_arr = array(); + $thumb = ''; + $image = ''; + + // Prepare thumb and image directory pathes and urls + $thumb_dir = WB_PATH.MEDIA_DIRECTORY.'/bakery/thumbs/item'.ITEM_ID.'/'; + $img_dir = WB_PATH.MEDIA_DIRECTORY.'/bakery/images/item'.ITEM_ID.'/'; + $thumb_url = WB_URL.MEDIA_DIRECTORY.'/bakery/thumbs/item'.ITEM_ID.'/'; + $img_url = WB_URL.MEDIA_DIRECTORY.'/bakery/images/item'.ITEM_ID.'/'; + + // Get image data from db + $query_image = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_images WHERE `item_id` = '".ITEM_ID."' AND `active` = '1' ORDER BY position ASC"); + if ($query_image->numRows() > 0) { + while ($image = $query_image->fetchRow()) { + $image = array_map('stripslashes', $image); + $image = array_map('htmlspecialchars', $image); + $img_id = $image['img_id']; + $item_attribute = $image['item_attribute_id']; + $image_file = $image['filename']; + $img_alt = $image['alt']; + $img_title = $image['title']; + $img_caption = $image['caption']; + + // Thumbs use .jpg extension only + $thumb_file = str_replace(".png", ".jpg", $image_file); + + // Prepare div image wrapper for image caption + $caption_prepend = empty($img_caption) ? '' : '
'; + $caption_append = empty($img_caption) ? '' : '
'.$img_caption.'
'; + + // Add unique image id that corresponds to the item attribute + $thumb_id = empty($item_attribute) ? '' : 'mod_bakery_thumb_attr'.$item_attribute.'_f'; + $img_id = empty($item_attribute) ? '' : 'mod_bakery_img_attr'.$item_attribute.'_f'; + + // Make array of all item thumbs and images + if (file_exists($thumb_dir.$thumb_file) && file_exists($img_dir.$image_file)) { + // If needed add lightbox2 link to the thumb/image... + if ($setting_lightbox2 == "detail" || $setting_lightbox2 == "all") { + $prepend = "".$img_alt.""; + $img_append = "' alt='".$img_alt."' title='".$img_title."' id='".$img_id."' class='mod_bakery_item_img_f' />"; + // ...else add thumb/image only + } else { + $prepend = "".$img_alt.""; + $img_append = "' alt='".$img_alt."' title='".$img_title."' id='".$img_id."' class='mod_bakery_item_img_f' />"; + } + // Make array + $thumb_arr[] = $prepend.$thumb_url.$thumb_file.$thumb_append; + $image_arr[] = $caption_prepend.$prepend.$img_url.$image_file.$img_append.$caption_append; + } + } + } + // Main thumb/image (image position 1) + $thumb = empty($thumb_arr[0]) ? '' : $thumb_arr[0]; + $image = empty($image_arr[0]) ? '' : $image_arr[0]; + unset($thumb_arr[0]); + unset($image_arr[0]); + + // Make strings for use in the item templates + $thumbs = implode("\n", $thumb_arr); + $images = implode("\n", $image_arr); + + + // Show item options and attributes if we have to + + // Initialize vars + $option = ''; + $option_select = ''; + $open_tr = ''; + $open_td = ''; + $close_td = "\n"; + $select_end = '
'."\n"; + // Wrap select in a table row + if ($use_table) { + $open_tr = ''."\n"; + $open_td = ''."\n"; + $close_td = "\n".''."\n"; + $select_end = ''."\n".''; + } + + // Get number of item options and loop for each of them + $query_num_options = $database->query("SELECT DISTINCT o.option_name, ia.option_id FROM ".TABLE_PREFIX."mod_bakery_options o INNER JOIN ".TABLE_PREFIX."mod_bakery_item_attributes ia ON o.option_id = ia.option_id WHERE ia.item_id = ".ITEM_ID); + if ($query_num_options->numRows() > 0) { + while ($num_options = $query_num_options->fetchRow()) { + $option_name = stripslashes($num_options['option_name']); + $option_id = stripslashes($num_options['option_id']); + + // Get item attributes + $query_attributes = $database->query("SELECT o.option_name, a.attribute_name, ia.attribute_id, ia.price, ia.operator FROM ".TABLE_PREFIX."mod_bakery_options o INNER JOIN ".TABLE_PREFIX."mod_bakery_attributes a ON o.option_id = a.option_id INNER JOIN ".TABLE_PREFIX."mod_bakery_item_attributes ia ON a.attribute_id = ia.attribute_id WHERE item_id = ".ITEM_ID." AND ia.option_id = '$option_id' ORDER BY o.option_name, LENGTH(a.attribute_name), a.attribute_name ASC"); + if ($query_attributes->numRows() > 0) { + $option_select .= $open_tr.$open_td.''.$option_name.': '.$close_td.$open_td.''."\n".$select_end; + $option = $option_select; + } + } + } + + // Check if we should show number of items, stock image or "in stock" message or nothing at all + $item_stock = stripslashes($item['stock']); + // Only show if item stock is not blank + if ($item_stock == '' && $setting_stock_mode != "none") { + $stock = $MOD_BAKERY['TXT_N/A']; + } else { + // Display number of items + if ($setting_stock_mode == "number") { + if ($item_stock < 1) { + $stock = 0; + } else { + $stock = $item_stock; + } + // Display stock image + } elseif ($setting_stock_mode == "img" && is_numeric($setting_stock_limit) && $setting_stock_limit != '') { + if ($item_stock < 1) { + $stock = "".$MOD_BAKERY["; + } elseif ($item_stock > $setting_stock_limit) { + $stock = "".$MOD_BAKERY["; + } else { + $stock = "".$MOD_BAKERY["; + } + // Display stock text message + } elseif ($setting_stock_mode == "text" && is_numeric($setting_stock_limit) && $setting_stock_limit != '') { + if ($item_stock < 1) { + $stock = "".$MOD_BAKERY['TXT_OUT_OF_STOCK'].""; + } elseif ($item_stock > $setting_stock_limit) { + $stock = "".$MOD_BAKERY['TXT_IN_STOCK'].""; + } else { + $stock = "".$MOD_BAKERY['TXT_SHORT_OF_STOCK'].""; + } + // Display nothing + } else { + $stock = ''; + } + } + + // Replace [wblinkPAGE_ID] generated by wysiwyg editor by real link + $item['full_desc'] = stripslashes($item['full_desc']); + $pattern = '/\[wblink(.+?)\]/s'; + preg_match_all($pattern,$item['full_desc'],$ids); + foreach ($ids[1] as $page_id) { + $pattern = '/\[wblink'.$page_id.'\]/s'; + // Get page link + $query_pages = $database->query("SELECT link FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id' LIMIT 1"); + $page = $query_pages->fetchRow(); + $link = WB_URL.PAGES_DIRECTORY.$page['link'].PAGE_EXTENSION; + $item['full_desc'] = preg_replace($pattern,$link,$item['full_desc']); + } + + // Replace placeholders by values + $vars = array('[ADD_TO_CART]', '[PAGE_TITLE]', '[THUMB]', '[THUMBS]', '[IMAGE]', '[IMAGES]', '[TITLE]', '[ITEM_ID]', '[SKU]', '[STOCK]', '[PRICE]', '[TAX_RATE]', '[SHIPPING]', '[FIELD_1]', '[FIELD_2]', '[FIELD_3]', '[OPTION]', '[DESCRIPTION]', '[FULL_DESC]', '[SHOP_URL]', '[SHIPPING_DOMESTIC]', '[SHIPPING_ABROAD]', '[SHIPPING_D_A]', '[CURRENCY]', '[BACK]', '[DATE]', '[TIME]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]', '[PREVIOUS]', '[NEXT]', '[OUT_OF]', '[OF]', '[TEXT_OUT_OF]', '[TEXT_OF]', '[TXT_ITEM]', '[TXT_SKU]', '[TXT_STOCK]', '[TXT_PRICE]', '[TXT_TAX_RATE]', '[TXT_SHIPPING]', '[TXT_FIELD_1]', '[TXT_FIELD_2]', '[TXT_FIELD_3]', '[TXT_FULL_DESC]', '[TXT_SHIPPING_COST]', '[TXT_DOMESTIC]', '[TXT_ABROAD]', '[TXT_BACK]'); + if (isset($users[$uid]['username']) AND $users[$uid]['username'] != '') { + $values = array($MOD_BAKERY['TXT_ADD_TO_CART'], PAGE_TITLE, $thumb, $thumbs, $image, $images, $title, ITEM_ID, stripslashes($item['sku']), $stock, $price, stripslashes($item['tax_rate']), stripslashes($item['shipping']), stripslashes($item['definable_field_0']), stripslashes($item['definable_field_1']), stripslashes($item['definable_field_2']), $option, stripslashes($item['description']), $item['full_desc'], $setting_continue_url, $setting_shipping_domestic, $setting_shipping_abroad, $setting_shipping_d_a, $setting_shop_currency, $page_link, $item_date, $item_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $previous_link, $next_link, $out_of, $of, $TEXT['OUT_OF'], $TEXT['OF'], $MOD_BAKERY['TXT_ITEM'], $MOD_BAKERY['TXT_SKU'], $MOD_BAKERY['TXT_STOCK'], $MOD_BAKERY['TXT_PRICE'], $MOD_BAKERY['TXT_TAX_RATE'], $MOD_BAKERY['TXT_SHIPPING'], $setting_definable_field_0, $setting_definable_field_1, $setting_definable_field_2, $MOD_BAKERY['TXT_FULL_DESC'], $MOD_BAKERY['TXT_SHIPPING_COST'], $MOD_BAKERY['TXT_DOMESTIC'], $MOD_BAKERY['TXT_ABROAD'], $TEXT['BACK']); + } else { + $values = array($MOD_BAKERY['TXT_ADD_TO_CART'], PAGE_TITLE, $thumb, $thumbs, $image, $images, $title, ITEM_ID, stripslashes($item['sku']), $stock, $price, stripslashes($item['tax_rate']), stripslashes($item['shipping']), stripslashes($item['definable_field_0']), stripslashes($item['definable_field_1']), stripslashes($item['definable_field_2']), $option, stripslashes($item['description']), $item['full_desc'], $setting_continue_url, $setting_shipping_domestic, $setting_shipping_abroad, $setting_shipping_d_a, $setting_shop_currency, $page_link, $item_date, $item_time, '', '', '', '', $previous_link, $next_link, $out_of, $of, $TEXT['OUT_OF'], $TEXT['OF'], $MOD_BAKERY['TXT_ITEM'], $MOD_BAKERY['TXT_SKU'], $MOD_BAKERY['TXT_STOCK'], $MOD_BAKERY['TXT_PRICE'], $MOD_BAKERY['TXT_TAX_RATE'], $MOD_BAKERY['TXT_SHIPPING'], $setting_definable_field_0, $setting_definable_field_1, $setting_definable_field_2, $MOD_BAKERY['TXT_FULL_DESC'], $MOD_BAKERY['TXT_SHIPPING_COST'], $MOD_BAKERY['TXT_DOMESTIC'], $MOD_BAKERY['TXT_ABROAD'], $TEXT['BACK']); + } + + // Print item header + echo str_replace($vars, $values, $setting_item_header); + + // Print item footer + echo str_replace($vars, $values, $setting_item_footer); + +} else { + echo $TEXT['NONE_FOUND']; + return; +} diff --git a/view_order.php b/view_order.php new file mode 100644 index 0000000..4a868a7 --- /dev/null +++ b/view_order.php @@ -0,0 +1,154 @@ +get_page_permission($page_id, $action='admin') === false) { + // User allowed to view this page + die($MESSAGE['ADMIN_INSUFFICIENT_PRIVELLIGES']); +} + + + +//Look for language File +if (LANGUAGE_LOADED) { + require_once(WB_PATH.'/modules/bakery/languages/EN.php'); + if (file_exists(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php')) { + require_once(WB_PATH.'/modules/bakery/languages/'.LANGUAGE.'.php'); + } +} + +// Header +?> + + + +<?php echo $MOD_BAKERY['TXT_ORDER']." ".$TEXT['VIEW_DETAILS']; ?> + + + + +query("SELECT invoice_id, invoice FROM ".TABLE_PREFIX."mod_bakery_customer WHERE order_id = '$order_id'"); +if ($query_customer->numRows() > 0) { + $customer = $query_customer->fetchRow(); + if ($customer['invoice'] != '') { + // Convert string to array + $invoice = stripslashes($customer['invoice']); + $invoice_array = explode("&&&&&", $invoice); + // Vars + $order_id = $invoice_array[0]; + #$shop_name = $invoice_array[1]; + #$bank_account = $invoice_array[2]; + #$cust_name = $invoice_array[3]; + #$address = $invoice_array[4]; + $cust_address = $invoice_array[5]; + $ship_address = $invoice_array[6]; + #$cust_email = $invoice_array[7]; + $html_item_list = $invoice_array[8]; + $order_date = $invoice_array[9]; + + $invoice_id = $customer['invoice_id']; + + // If given get customer tax no + $cust_tax_no = isset($invoice_array[15]) ? $invoice_array[15] : ''; + $display_tax_no = $cust_tax_no == '' ? 'none' : 'table-row'; + + // If given get customers message + $cust_msg = isset($invoice_array[16]) ? nl2br($invoice_array[16]) : ''; + $display_cust_msg = $cust_msg == '' ? 'none' : 'table-row'; + + // Change frontend classes (eg. mod_bakery_anything_f) to backend classes (eg. mod_bakery_anything_b) + $html_item_list = str_replace("_f'", "_b'", $html_item_list); + + +// Show order +?> + +
+ + + + + + + + + + + + + + + + + +
+ : ".$order_id; ?>
+ : ".$invoice_id; ?>
+ : ".$order_date; ?>
+ + + + + + + + + + + + +
 
+
+ + + + + +
+
  + +
+
+ + ".$TEXT['NONE_FOUND']."!

"; + echo "

"; + } +} +?> + + diff --git a/view_overview.php b/view_overview.php new file mode 100644 index 0000000..09bfa3e --- /dev/null +++ b/view_overview.php @@ -0,0 +1,301 @@ + + + + + = 0 ? $_GET['p'] : 0; +$_SESSION['bakery']['position'] = $position; + +// Get total number of items +$query_total_num = $database->query("SELECT item_id FROM ".TABLE_PREFIX."mod_bakery_items WHERE section_id = '$section_id' AND active = '1' AND title != ''"); +$total_num = $query_total_num->numRows(); + +// Work-out if we need to add limit code to sql +if ($setting_items_per_page != 0) { + $limit_sql = " LIMIT $position, $setting_items_per_page"; +} else { + $limit_sql = ''; +} + +// Query items (for this page) +$query_items = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_items WHERE section_id = '$section_id' AND active = '1' AND title != '' ORDER BY position ASC".$limit_sql); +$num_items = $query_items->numRows(); + +// Create previous and next links for pagination +if ($setting_items_per_page > 0) { + + // Previous links + if ($position > 0) { + $pl_prepend = '« '; + $pl_append = ''; + $previous_link = $pl_prepend.$TEXT['PREVIOUS'].$pl_append; + $previous_page_link = $pl_prepend.$TEXT['PREVIOUS_PAGE'].$pl_append; + } else { + $previous_link = ''; + $previous_page_link = ''; + } + + // Next links + if ($position + $setting_items_per_page >= $total_num) { + $next_link = ''; + $next_page_link = ''; + } else { + $nl_prepend = ' '; + $nl_append = ' »'; + $next_link = $nl_prepend.$TEXT['NEXT'].$nl_append; + $next_page_link = $nl_prepend.$TEXT['NEXT_PAGE'].$nl_append; + } + + // Item position out of total items + if ($position + $setting_items_per_page > $total_num) { + $num_of = $position + $num_items; + } else { + $num_of = $position + $setting_items_per_page; + } + + $item_num = $position + 1 == $num_of ? ($position + 1) : ($position + 1).'-'.$num_of; + + $out_of = $item_num.' '.strtolower($TEXT['OUT_OF']).' '.$total_num; + $of = $item_num.' '.strtolower($TEXT['OF']).' '.$total_num; + $display_previous_next_links = ''; + +// No pagination +} else { + $display_previous_next_links = 'none'; +} + + + +// Print header +if ($display_previous_next_links == 'none') { + echo str_replace(array('[PAGE_TITLE]','[SHOP_URL]','[VIEW_CART]','[NEXT_PAGE_LINK]','[NEXT_LINK]','[PREVIOUS_PAGE_LINK]','[PREVIOUS_LINK]','[OUT_OF]','[OF]','[DISPLAY_PREVIOUS_NEXT_LINKS]','[TXT_ITEM]'), array(PAGE_TITLE,$setting_continue_url, $MOD_BAKERY['TXT_VIEW_CART'],'','','','','','', $display_previous_next_links, $MOD_BAKERY['TXT_ITEM']), $setting_header); +} else { + echo str_replace(array('[PAGE_TITLE]','[SHOP_URL]','[VIEW_CART]','[NEXT_PAGE_LINK]','[NEXT_LINK]','[PREVIOUS_PAGE_LINK]','[PREVIOUS_LINK]','[OUT_OF]','[OF]','[DISPLAY_PREVIOUS_NEXT_LINKS]','[TXT_ITEM]'), array(PAGE_TITLE,$setting_continue_url, $MOD_BAKERY['TXT_VIEW_CART'], $next_page_link, $next_link, $previous_page_link, $previous_link, $out_of, $of, $display_previous_next_links, $MOD_BAKERY['TXT_ITEM']), $setting_header); +} + + +// Loop through and show items +if ($num_items > 0) { + $counter = 0; + while ($item = $query_items->fetchRow()) { + $item_id = stripslashes($item['item_id']); + $title = htmlspecialchars(stripslashes($item['title'])); + $price = number_format(stripslashes($item['price']), 2, $setting_dec_point, $setting_thousands_sep); + $uid = $item['modified_by']; // User who last modified the item + // Workout date and time of last modified item + $item_date = gmdate(DATE_FORMAT, $item['modified_when']+TIMEZONE); + $item_time = gmdate(TIME_FORMAT, $item['modified_when']+TIMEZONE); + // Work-out the item link + $item_link = WB_URL.PAGES_DIRECTORY.$item['link'].PAGE_EXTENSION; + + + // Item thumb(s) and image(s) + + // Initialize or reset thumb(s) and image(s) befor laoding next item + $thumb_arr = array(); + $image_arr = array(); + $thumb = ''; + $image = ''; + + // Get image data from db + $query_image = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_images WHERE `item_id` = '$item_id' AND `active` = '1' ORDER BY position ASC"); + if ($query_image->numRows() > 0) { + while ($image = $query_image->fetchRow()) { + $image = array_map('stripslashes', $image); + $image = array_map('htmlspecialchars', $image); + $img_id = $image['img_id']; + $item_attribute = $image['item_attribute_id']; + $image_file = $image['filename']; + $img_alt = $image['alt']; + $img_title = $image['title']; + $img_caption = $image['caption']; + + // Thumbs use .jpg extension only + $thumb_file = str_replace(".png", ".jpg", $image_file); + + // Prepare thumb and image directory pathes and urls + $thumb_dir = WB_PATH.MEDIA_DIRECTORY.'/bakery/thumbs/item'.$item_id.'/'; + $img_dir = WB_PATH.MEDIA_DIRECTORY.'/bakery/images/item'.$item_id.'/'; + $thumb_url = WB_URL.MEDIA_DIRECTORY.'/bakery/thumbs/item'.$item_id.'/'; + $img_url = WB_URL.MEDIA_DIRECTORY.'/bakery/images/item'.$item_id.'/'; + + // Make array of all item thumbs and images + if (file_exists($thumb_dir.$thumb_file) && file_exists($img_dir.$image_file)) { + // If needed add lightbox2 link to the thumb/image... + if ($setting_lightbox2 == "overview" || $setting_lightbox2 == "all") { + $thumb_prepend = "".$img_alt.""; + $img_append = "' alt='".$img_alt."' title='".$img_title."' class='mod_bakery_main_img_f' />"; + // ...else add thumb/image only + } else { + $thumb_prepend = ""; + $img_append = "' alt='".$img_alt."' title='".$img_title."' class='mod_bakery_main_img_f' />"; + } + // Make array + $thumb_arr[] = $thumb_prepend.$thumb_url.$thumb_file.$thumb_append; + $image_arr[] = $img_prepend.$img_url.$image_file.$img_append; + } + } + } + // Main thumb/image (image position 1) + $thumb = empty($thumb_arr[0]) ? '' : $thumb_arr[0]; + $image = empty($image_arr[0]) ? '' : $image_arr[0]; + unset($thumb_arr[0]); + unset($image_arr[0]); + + // Make strings for use in the item templates + $thumbs = implode("\n", $thumb_arr); + $images = implode("\n", $image_arr); + + + + // Show item options and attributes if we have to + + // Initialize vars + $option = ''; + $option_select = ''; + + // Get number of item options and loop through them + $query_num_options = $database->query("SELECT DISTINCT o.option_name, ia.option_id FROM ".TABLE_PREFIX."mod_bakery_options o INNER JOIN ".TABLE_PREFIX."mod_bakery_item_attributes ia ON o.option_id = ia.option_id WHERE ia.item_id = $item_id"); + if ($query_num_options->numRows() > 0) { + while ($num_options = $query_num_options->fetchRow()) { + $option_name = stripslashes($num_options['option_name']); + $option_id = stripslashes($num_options['option_id']); + + // Get item attributes + $query_attributes = $database->query("SELECT o.option_name, a.attribute_name, ia.attribute_id, ia.price, ia.operator FROM ".TABLE_PREFIX."mod_bakery_options o INNER JOIN ".TABLE_PREFIX."mod_bakery_attributes a ON o.option_id = a.option_id INNER JOIN ".TABLE_PREFIX."mod_bakery_item_attributes ia ON a.attribute_id = ia.attribute_id WHERE item_id = $item_id AND ia.option_id = '$option_id' ORDER BY o.option_name, LENGTH(a.attribute_name), a.attribute_name ASC"); + if ($query_attributes->numRows() > 0) { + $option_select .= $option_name.":
"; + $option = $option_select; + } + } + } + + // Check if we should show number of items, stock image or "in stock" message or nothing at all + $item_stock = stripslashes($item['stock']); + // Only show if item stock is not blank + if ($item_stock == '' && $setting_stock_mode != "none") { + $stock = $MOD_BAKERY['TXT_N/A']; + } else { + // Display number of items + if ($setting_stock_mode == "number") { + if ($item_stock < 1) { + $stock = 0; + } else { + $stock = $item_stock; + } + // Display stock image + } elseif ($setting_stock_mode == "img" && is_numeric($setting_stock_limit) && $setting_stock_limit != '') { + if ($item_stock < 1) { + $stock = "".$MOD_BAKERY["; + } elseif ($item_stock > $setting_stock_limit) { + $stock = "".$MOD_BAKERY["; + } else { + $stock = "".$MOD_BAKERY["; + } + // Display stock text message + } elseif ($setting_stock_mode == "text" && is_numeric($setting_stock_limit) && $setting_stock_limit != '') { + if ($item_stock < 1) { + $stock = "".$MOD_BAKERY['TXT_OUT_OF_STOCK'].""; + } elseif ($item_stock > $setting_stock_limit) { + $stock = "".$MOD_BAKERY['TXT_IN_STOCK'].""; + } else { + $stock = "".$MOD_BAKERY['TXT_SHORT_OF_STOCK'].""; + } + } else { + $stock = ''; + } + } + + // Replace placeholders by values + $vars = array('[ADD_TO_CART]', '[PAGE_TITLE]', '[THUMB]', '[THUMBS]', '[IMAGE]', '[IMAGES]', '[TITLE]', '[ITEM_ID]', '[SKU]', '[STOCK]', '[PRICE]', '[TAX_RATE]', '[SHIPPING]', '[FIELD_1]', '[FIELD_2]', '[FIELD_3]', '[OPTION]', '[DESCRIPTION]', '[FULL_DESC]', '[SHOP_URL]', '[SHIPPING_DOMESTIC]', '[SHIPPING_ABROAD]', '[SHIPPING_D_A]', '[CURRENCY]', '[LINK]', '[DATE]', '[TIME]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]', '[TEXT_READ_MORE]', '[TXT_ITEM]', '[TXT_PRICE]', '[TXT_TAX_RATE]', '[TXT_STOCK]', '[TXT_FIELD_1]', '[TXT_FIELD_2]', '[TXT_FIELD_3]'); + if (isset($users[$uid]['username']) AND $users[$uid]['username'] != '') { + $values = array($MOD_BAKERY['TXT_ADD_TO_CART'], PAGE_TITLE, $thumb, $thumbs, $image, $images, $title, $item_id, stripslashes($item['sku']), $stock, $price, stripslashes($item['tax_rate']), stripslashes($item['shipping']), stripslashes($item['definable_field_0']), stripslashes($item['definable_field_1']), stripslashes($item['definable_field_2']), $option, stripslashes($item['description']), stripslashes($item['full_desc']), $setting_continue_url, $setting_shipping_domestic, $setting_shipping_abroad, $setting_shipping_d_a, $setting_shop_currency, $item_link, $item_date, $item_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $TEXT['READ_MORE'], $MOD_BAKERY['TXT_ITEM'], $MOD_BAKERY['TXT_PRICE'], $MOD_BAKERY['TXT_TAX_RATE'], $MOD_BAKERY['TXT_STOCK'], $setting_definable_field_0, $setting_definable_field_1, $setting_definable_field_2); + } else { + $values = array($MOD_BAKERY['TXT_ADD_TO_CART'], PAGE_TITLE, $thumb, $thumbs, $image, $images, $title, $item_id, stripslashes($item['sku']), $stock, $price, stripslashes($item['tax_rate']), stripslashes($item['shipping']), stripslashes($item['definable_field_0']), stripslashes($item['definable_field_1']), stripslashes($item['definable_field_2']), $option, stripslashes($item['description']), stripslashes($item['full_desc']), $setting_continue_url, $setting_shipping_domestic, $setting_shipping_abroad, $setting_shipping_d_a, $setting_shop_currency, $item_link, $item_date, $item_time, '', '', '', '', $TEXT['READ_MORE'], $MOD_BAKERY['TXT_ITEM'], $MOD_BAKERY['TXT_PRICE'], $MOD_BAKERY['TXT_TAX_RATE'], $MOD_BAKERY['TXT_STOCK'], $setting_definable_field_0, $setting_definable_field_1, $setting_definable_field_2); + } + echo str_replace($vars, $values, $setting_item_loop); + // Increment counter + $counter = $counter + 1; + // Check if we should end this row + if ($counter % $setting_num_cols == 0 && $counter != $num_items) { + echo "\n"; + } + } + + // Add cells to complete an open row at the end of the table + if ($counter > $setting_num_cols) { + while ($counter % $setting_num_cols != 0) { + echo " \n"; + $counter++; + } + } +} + + +// Print footer +if ($display_previous_next_links == 'none') { + echo str_replace(array('[PAGE_TITLE]','[NEXT_PAGE_LINK]','[NEXT_LINK]','[PREVIOUS_PAGE_LINK]','[PREVIOUS_LINK]','[OUT_OF]','[OF]','[DISPLAY_PREVIOUS_NEXT_LINKS]','[TXT_ITEM]'), array(PAGE_TITLE,'','','','','','', $display_previous_next_links, $MOD_BAKERY['TXT_ITEM']), $setting_footer); +} else { + echo str_replace(array('[PAGE_TITLE]','[NEXT_PAGE_LINK]','[NEXT_LINK]','[PREVIOUS_PAGE_LINK]','[PREVIOUS_LINK]','[OUT_OF]','[OF]','[DISPLAY_PREVIOUS_NEXT_LINKS]','[TXT_ITEM]'), array(PAGE_TITLE,$next_page_link, $next_link, $previous_page_link, $previous_link, $out_of, $of, $display_previous_next_links, $MOD_BAKERY['TXT_ITEM']), $setting_footer); +} diff --git a/view_pay_methods.php b/view_pay_methods.php new file mode 100644 index 0000000..0ab97e3 --- /dev/null +++ b/view_pay_methods.php @@ -0,0 +1,108 @@ +set_unknowns('remove'); +// Define debug mode (0:=disabled (default), 1:=variable assignments, 2:=calls to get variable, 4:=debug internals) +$tpl->debug = 0; + +// Include WB functions file +require_once(WB_PATH.'/framework/functions.php'); + +// Assign page filename for tracking with Google Analytics _trackPageview() function +global $ga_page; +$ga_page = '/view_pay_method.php'; + + + +// TITLE, CUSTOMERS MESSAGE AND TERMS & CONDITIONS +// *********************************************** + +// Customers message +$display_cust_msg = $setting_cust_msg == 'show' ? 'table-row' : 'none'; +$cust_msg = ''; +if (!empty($_SESSION['bakery']['cust_msg'])) { + $cust_msg = htmlspecialchars($_SESSION['bakery']['cust_msg'], ENT_QUOTES); +} + + + +// If tac url is set customers have to accept the terms & conditions +if (!empty($setting_tac_url)) { + $tac_input_type = 'checkbox'; + $tac_link = "{$MOD_BAKERY['TXT_AGREE']} $setting_shop_name"; + $js_check_tac = "return checkTaC('{$MOD_BAKERY['TXT_JS_AGREE']}')"; +} else { + $tac_input_type = 'hidden'; + $tac_link = ''; + $js_check_tac = ''; +} + +// Show title, customers message and terms & conditions using template file +$tpl->set_file('pay_methods_title', 'title.htm'); +$tpl->set_var(array( + 'WB_URL' => WB_URL, + 'TXT_TAC_AND_PAY_METHOD' => $MOD_BAKERY['TXT_TAC_AND_PAY_METHOD'], + 'TXT_JS_AGREE' => $MOD_BAKERY['TXT_JS_AGREE'], + 'SETTING_CONTINUE_URL' => $setting_continue_url, + 'TAC_INPUT_TYPE' => $tac_input_type, + 'TAC_LINK' => $tac_link, + 'TXT_PAY_METHOD' => $MOD_BAKERY['TXT_SELECT_PAY_METHOD'], + 'DISPLAY_CUST_MSG' => $display_cust_msg, + 'TXT_ENTER_CUST_MSG' => $MOD_BAKERY['TXT_ENTER_CUST_MSG'], + 'CUST_MSG' => $cust_msg +)); +$tpl->pparse('output', 'pay_methods_title'); + + + + +// DISPLAY LIST OF PAYMENT METHODS +// ******************************* + +// Only show payment method/payment gateway if we have to +if ($num_payment_methods > 0) { + foreach ($setting_payment_methods as $payment_method) { + if (is_file(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/gateway.php')) { + include(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/gateway.php'); + } + } +} else { + // Show payment methods error using template file + $tpl->set_file('pay_methods_error', 'error.htm'); + $tpl->set_var(array( + 'ERR_NO_PAYMENT_METHOD' => $MOD_BAKERY['ERR_NO_PAYMENT_METHOD'] + )); + $tpl->pparse('output', 'pay_methods_error'); +} + +// Show payment methods footer using template file +$tpl->set_file('pay_methods_footer', 'footer.htm'); +$tpl->set_var(array( + 'ERR_NO_PAYMENT_METHOD' => $MOD_BAKERY['ERR_NO_PAYMENT_METHOD'] +)); +$tpl->pparse('output', 'pay_methods_footer'); diff --git a/view_summary.php b/view_summary.php new file mode 100644 index 0000000..1c0605f --- /dev/null +++ b/view_summary.php @@ -0,0 +1,946 @@ +set_unknowns('keep'); +// Define debug mode (0:=disabled (default), 1:=variable assignments, 2:=calls to get variable, 4:=debug internals) +$tpl_so->debug = 0; + +// Create template object for invoice print +$tpl_ip = new Template(WB_PATH.'/modules/bakery/templates/invoice'); +// Define how to deal with unknown {PLACEHOLDERS} (remove:=default, keep, comment) +$tpl_ip->set_unknowns('keep'); +// Define debug mode (0:=disabled (default), 1:=variable assignments, 2:=calls to get variable, 4:=debug internals) +$tpl_ip->debug = 0; + +// Get order id +$order_id = $_SESSION['bakery']['order_id']; + + + +// CUSTOMERS MESSAGE +// ***************** + +// Get customers message +$cust_msg = !empty($_POST['cust_msg']) ? strip_tags($_POST['cust_msg']) : ''; +// Save customers message in session var +$_SESSION['bakery']['cust_msg'] = $cust_msg; + + + +// PAYMENT METHOD +// ************** + +// Put payment method selected by user into session var +if (!empty($_POST['payment_method'])) { + $payment_method_arr = array_keys($_POST['payment_method']); + $payment_method_arr = array_intersect($payment_method_arr, $setting_payment_methods); + $_SESSION['bakery']['payment_method'] = $payment_method_arr[0]; +} +$payment_method = $_SESSION['bakery']['payment_method']; + + + +// CHECK IF CUSTOMER HAS AGREED TO TERMS AND CONDITIONS +// **************************************************** + +if (!isset($_POST['agree']) || $_POST['agree'] != 'yes') { + // Error message if customer has not agreed to terms and conditions, then show it again + + $tpl_so->set_file('agree_tac', 'err_agree_tac.htm'); + $tpl_so->set_var(array( + 'ERR_AGREE' => $MOD_BAKERY['ERR_AGREE'], + 'SETTING_CONTINUE_URL' => $setting_continue_url, + 'SETTING_TAC_URL' => $setting_tac_url, + 'TXT_AGREE' => $MOD_BAKERY['TXT_AGREE'], + 'SETTING_SHOP_NAME' => $setting_shop_name, + 'TXT_SUBMIT_ORDER' => $MOD_BAKERY['TXT_SUBMIT_ORDER'] + )); + $tpl_so->pparse('output', 'agree_tac'); + return; +} + + + +// EMPTY CART +// ********** + +// If cart is empty, show an error message and a "continue shopping" button +$sql_result1 = $database->query("SELECT * FROM " .TABLE_PREFIX."mod_bakery_order WHERE order_id = '$order_id'"); +$n_row = $sql_result1->numRows(); +if ($n_row < 1) { + // Show empty cart error message using template file + $tpl_so->set_file('empty_cart', 'err_empty_cart.htm'); + $tpl_so->set_var(array( + 'ERR_CART_EMPTY' => $MOD_BAKERY['ERR_CART_EMPTY'], + 'TXT_CONTINUE_SHOPPING' => $MOD_BAKERY['TXT_CONTINUE_SHOPPING'] + )); + $tpl_so->pparse('output', 'empty_cart'); + return; +} + + + +// GET ITEM DETAILS FROM DATABASE +// ****************************** + +// Get item id, attributes, sku, quantity, price and tax_rate from db order table +$i = 1; +while ($row1 = $sql_result1->fetchRow()) { + foreach ($row1 as $field => $value) { + if ($field != 'order_id') { + $items[$i][$field] = $value; + // Get item name and shipping from db items table + if ($field == 'item_id') { + $sql_result2 = $database->query("SELECT title, shipping, description FROM " .TABLE_PREFIX."mod_bakery_items WHERE item_id = '$row1[item_id]'"); + $row2 = $sql_result2->fetchRow(); + $items[$i]['name'] = $row2[0]; + $items[$i]['shipping'] = $row2[1]; + $items[$i]['description'] = $row2[2]; + } + } + } + // Default if item has no attributes + $items[$i]['html_show_attribute'] = ''; + $items[$i]['email_show_attribute'] = ''; + $items[$i]['attribute_price'] = 0; + // Initialize vars + $items[$i]['show_attribute'] = ''; + $attribute['operator'] = ''; + // Get item attribute ids + if ($items[$i]['attributes'] != "none") { + $attribute_ids = explode(",", $items[$i]['attributes']); + foreach ($attribute_ids as $attribute_id) { + // Get option name and attribute name, price, operator (=/+/-) + $query_attributes = $database->query("SELECT o.option_name, a.attribute_name, ia.price, ia.operator FROM ".TABLE_PREFIX."mod_bakery_options o INNER JOIN ".TABLE_PREFIX."mod_bakery_attributes a ON o.option_id = a.option_id INNER JOIN ".TABLE_PREFIX."mod_bakery_item_attributes ia ON a.attribute_id = ia.attribute_id WHERE ia.item_id = {$items[$i]['item_id']} AND ia.attribute_id = $attribute_id"); + $attribute = $query_attributes->fetchRow(); + // Calculate the item attribute prices sum depending on the operator + if ($attribute['operator'] == "+") { + $items[$i]['attribute_price'] = $items[$i]['attribute_price'] + $attribute['price']; + } elseif ($attribute['operator'] == "-") { + $items[$i]['attribute_price'] = $items[$i]['attribute_price'] - $attribute['price']; + // If operator is '=' then override the item price by the attribute price + } elseif ($attribute['operator'] == "=") { + $items[$i]['price'] = $attribute['price']; + } + // Prepare option and attributes for display in cart table + $items[$i]['show_attribute'] .= ", ".$attribute['option_name'].": ".$attribute['attribute_name']; + } + // Now calculate item price including all attribute prices + $items[$i]['price'] = $items[$i]['price'] + $items[$i]['attribute_price']; + // Never undercut zero + $items[$i]['price'] = $items[$i]['price'] < 0 ? 0 : $items[$i]['price']; + // Make string with all item attributes + // HTML version: remove leading comma and space + $items[$i]['html_show_attribute'] = substr($items[$i]['show_attribute'], 2); + // Email version: add \n\t to html version and replace   by space + $items[$i]['email_show_attribute'] = "\n\t".str_replace(" ", " ", $items[$i]['html_show_attribute']); + } + // Increment counter + $i++; +} + + + +// MAKE CUSTOMER AND SHIPPING ADDRESS FOR DIFFERENT SYSTEMS +// ******************************************************** + +// Get charset +if (defined('DEFAULT_CHARSET')) { $charset = DEFAULT_CHARSET; } else { $charset = 'utf-8'; } + +// Include country file depending on the language +if (LANGUAGE_LOADED) { + if (file_exists(WB_PATH.'/modules/bakery/languages/countries/'.LANGUAGE.'.php')) { + require_once(WB_PATH.'/modules/bakery/languages/countries/'.LANGUAGE.'.php'); + } +} +else { + require_once(WB_PATH.'/modules/bakery/languages/countries/EN.php'); +} + +// Set default state for countries without a state file +$MOD_BAKERY['TXT_STATE_CODE'][1] = ''; +$MOD_BAKERY['TXT_STATE_NAME'][1] = ''; +// Include state file depending on the shop country +if (file_exists(WB_PATH.'/modules/bakery/languages/states/'.$setting_shop_country.'.php')) { + require_once(WB_PATH.'/modules/bakery/languages/states/'.$setting_shop_country.'.php'); +} + + +// GET CUSTOMER DATA + +// Arrays for all forms and fields +$forms = array('cust', 'ship'); +$fields = array('company', 'first_name', 'last_name', 'tax_no', 'street', 'city', 'state', 'country', 'zip', 'email', 'phone'); +// Get customer data from the session var +foreach ($forms as $form) { + foreach ($fields as $field) { + $field_var = $form.'_'.$field; + if (isset($_SESSION['bakery'][$form][$field])) { + $$field_var = $_SESSION['bakery'][$form][$field]; + } else { + $$field_var = ''; + } + } +} + + +// CUSTOMER ADDRESS + +// Convert country code to country name +$country_key = array_keys($MOD_BAKERY['TXT_COUNTRY_CODE'], $cust_country); +$cust_country_name = $MOD_BAKERY['TXT_COUNTRY_NAME'][$country_key[0]]; +// Convert country to uppercase +if (function_exists('mb_strtoupper')) { + $cust_country_name = mb_strtoupper(entities_to_umlauts($cust_country_name, $charset), $charset); +} + +// Retain state code for sales tax calculation +$cust_state_code = $cust_state; +// Convert state code to state name +if ($state_key = array_keys($MOD_BAKERY['TXT_STATE_CODE'], $cust_state)) { + $cust_state = $MOD_BAKERY['TXT_STATE_NAME'][$state_key[0]]; + $cust_state = entities_to_umlauts($cust_state, $charset); +} + +// Join customer first and last name +$cust_name = $cust_first_name." ".$cust_last_name; + +// Prepare field customer company +if ($setting_company_field != "show" OR $cust_company == '') { + $email_cust_company = ''; + $cust_company = ''; +} +else { + $email_cust_company = $cust_company."\n\t"; + $cust_company = $cust_company.'
'; +} + +// Show address with state field +if ($setting_state_field == "show") { + if ($setting_zip_location == "end") { + // Show zip at the end of address + $cust_address = $cust_company."$cust_name
$cust_street
$cust_city, $cust_state $cust_zip
$cust_country_name

$cust_phone
$cust_email"; + $email_cust_address = "\t".$email_cust_company.$cust_name."\n\t".$cust_street."\n\t".$cust_city.", ".$cust_state." ".$cust_zip."\n\t".$cust_country_name."\n\n\t".$cust_phone."\n"; + } + else { + // Show zip inside of address + $cust_address = $cust_company."$cust_name
$cust_street
$cust_country-$cust_zip $cust_city
$cust_state
$cust_country_name

$cust_phone
$cust_email"; + $email_cust_address = "\t".$email_cust_company.$cust_name."\n\t".$cust_street."\n\t".$cust_country."-".$cust_zip." ".$cust_city."\n\t".$cust_state."\n\t".$cust_country_name."\n\n\t".$cust_phone."\n"; + } +} +// Show address w/o state field +else { + if ($setting_zip_location == "end") { + // Show zip at the end of address + $cust_address = $cust_company."$cust_name
$cust_street
$cust_city
$cust_country-$cust_zip
$cust_country_name

$cust_phone
$cust_email"; + $email_cust_address = "\t".$email_cust_company.$cust_name."\n\t".$cust_street."\n\t".$cust_city."\n\t".$cust_country."-".$cust_zip."\n\t".$cust_country_name."\n\n\t".$cust_phone."\n"; + } + else { + // Show zip inside of address + $cust_address = $cust_company."$cust_name
$cust_street
$cust_country-$cust_zip $cust_city
$cust_country_name

$cust_phone
$cust_email"; + $email_cust_address = "\t".$email_cust_company.$cust_name."\n\t".$cust_street."\n\t".$cust_country."-".$cust_zip." ".$cust_city."\n\t".$cust_country_name."\n\n\t".$cust_phone."\n"; + } +} + +// Make var that contains either customer address or - if existing - shipping address +$email_address = $email_cust_address; +$address = $cust_address; + + + +// SHIPPING ADDRESS + +if ($setting_shipping_form == "always" || $_SESSION['bakery']['ship_data']) { + + // Convert country code to country name + $country_key = array_keys($MOD_BAKERY['TXT_COUNTRY_CODE'], $ship_country); + $ship_country_name = $MOD_BAKERY['TXT_COUNTRY_NAME'][$country_key[0]]; + // Convert country to uppercase + if (function_exists('mb_strtoupper')) { + $ship_country_name = mb_strtoupper(entities_to_umlauts($ship_country_name, $charset), $charset); + } + + // Convert state code to state name + if ($state_key = array_keys($MOD_BAKERY['TXT_STATE_CODE'], $ship_state)) { + $ship_state = $MOD_BAKERY['TXT_STATE_NAME'][$state_key[0]]; + $ship_state = entities_to_umlauts($ship_state, $charset); + } + + // Join customer first and last name + $ship_name = $ship_first_name." ".$ship_last_name; + + // Prepare field shipping company + if ($setting_company_field != "show" OR $ship_company == '') { + $email_ship_company = ''; + $ship_company = ''; + } + else { + $email_ship_company = $ship_company."\n\t"; + $ship_company = $ship_company.'
'; + } + + // Show address with state field + if ($setting_state_field == "show") { + if ($setting_zip_location == "end") { + // Show zip at the end of address + $ship_address = $ship_company."$ship_name
$ship_street
$ship_city, $ship_state $ship_zip
$ship_country_name"; + $email_ship_address = "\t".$email_ship_company.$ship_name."\n\t".$ship_street."\n\t".$ship_city.", ".$ship_state." ".$ship_zip."\n"; + } + else { + // Show zip inside of address + $ship_address = $ship_company."$ship_name
$ship_street
$ship_country-$ship_zip $ship_city
$ship_state
$ship_country_name"; + $email_ship_address = "\t".$email_ship_company.$ship_name."\n\t".$ship_street."\n\t".$ship_country."-".$ship_zip." ".$ship_city."\n\t".$ship_state."\n\t".$ship_country_name."\n"; + } + } + // Show address w/o state field + else { + if ($setting_zip_location == "end") { + // Show zip at the end of address + $ship_address = $ship_company."$ship_name
$ship_street
$ship_city
$ship_country-$ship_zip
$ship_country_name"; + $email_ship_address = "\t".$email_ship_company.$ship_name."\n\t".$ship_street."\n\t".$ship_city."\n\t".$ship_country."-".$ship_zip."\n\t".$ship_country_name."\n"; + } + else { + // Show zip inside of address + $ship_address = $ship_company."$ship_name
$ship_street
$ship_country-$ship_zip $ship_city
$ship_country_name"; + $email_ship_address = "\t".$email_ship_company.$ship_name."\n\t".$ship_street."\n\t".$ship_country."-".$ship_zip." ".$ship_city."\n\t".$ship_country_name."\n"; + } + } + // Make var that contains either customer address or - if existing - the shipping address + $email_address = $email_ship_address; + $address = $ship_address; +} +// No shipping address +else { + $ship_address = ''; + $MOD_BAKERY['TXT_SHIP_ADDRESS'] = ''; + $email_ship_address = "\t".$TEXT['NONE']; +} + + + +// DISPLAY CUSTOMER TAX NUMBER +// *************************** + +$display_tax_no = ''; +if ($cust_tax_no == '') { + $display_tax_no = 'none'; +} + + + +// CALCULATE ITEMS SALES TAX +// ************************* + +// Initialize vars +$sales_tax = 0; +$f_tax_rate_array = array(); + +// Calculate items sales tax +for ($i = 1; $i <= sizeof($items); $i++) { + if ($setting_tax_included == 'included') { + // Calculate tax amount for prices including tax (brutto) + $sales_tax = $sales_tax + $items[$i]['price'] * $items[$i]['quantity'] * $items[$i]['tax_rate'] / (100 + $items[$i]['tax_rate']); + } + else { + // Calculate tax amount for prices excluding tax (netto) + $sales_tax = $sales_tax + $items[$i]['price'] * $items[$i]['quantity'] / 100 * $items[$i]['tax_rate']; + } + // Get tax rate(s) for display + $f_tax_rate_array[] = number_format($items[$i]['tax_rate'], 1); +} + + + +// SHOW TITLE AND ADDRESS +// ********************** + +// Assign page filename for tracking with Google Analytics _trackPageview() function +global $ga_page; +$ga_page = '/view_summary.php'; + +// Show summary title and address using template file +$tpl_so->set_file('summary_address', 'address.htm'); +$tpl_so->set_var(array( + 'TXT_ORDER_SUMMARY' => $MOD_BAKERY['TXT_ORDER_SUMMARY'], + 'TXT_ORDER_ID' => $MOD_BAKERY['TXT_ORDER_ID'], + 'ORDER_ID' => $order_id, + 'WB_URL' => WB_URL, + 'SETTING_CONTINUE_URL' => $setting_continue_url, + 'TXT_ADDRESS' => $MOD_BAKERY['TXT_ADDRESS'], + 'CUST_ADDRESS' => $cust_address, + 'DISPLAY_TAX_NO' => $display_tax_no, + 'TXT_CUST_TAX_NO' => $MOD_BAKERY['TXT_CUST_TAX_NO'], + 'CUST_TAX_NO' => $cust_tax_no, + 'TXT_SHIP_ADDRESS' => $MOD_BAKERY['TXT_SHIP_ADDRESS'], + 'SHIP_ADDRESS' => $ship_address, + 'TXT_MODIFY_ADDRESS' => $MOD_BAKERY['TXT_MODIFY_ADDRESS'] +)); +$tpl_so->pparse('output', 'summary_address'); + + + +// SHOW PAYMENT METHOD +// ******************* + +// Look for payment method language file +if (LANGUAGE_LOADED) { + include(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/languages/EN.php'); + if (file_exists(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/languages/'.LANGUAGE.'.php')) { + include(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/languages/'.LANGUAGE.'.php'); + } +} + +// Show payment methode selected by customer +$tpl_so->set_file('payment_method', 'pay_method.htm'); +$tpl_so->set_var(array( + 'TXT_SELECTED_PAY_METHOD' => $MOD_BAKERY['TXT_SELECTED_PAY_METHOD'], + 'PAY_METHOD' => $MOD_BAKERY[$payment_method]['TXT_TITLE'], + 'TXT_MODIFY_PAY_METHODS' => $MOD_BAKERY['TXT_MODIFY_PAY_METHODS'] +)); +$tpl_so->pparse('output', 'payment_method'); + + + +// SHOW SUMMARY TABLE +// ****************** + +// Determine shipping per item sum of all items specified +for ($i = 1; $i <= sizeof($items); $i++) { + $shipping_array[] = $items[$i]['shipping']; +} +$shipping_sum = array_sum($shipping_array); +// Check if we have to display a tax rate column in the invoice +$num_of_tax_rates = count(array_unique($f_tax_rate_array)); + + +// Prepare table settings depending on different conditions: +// Shipping per item and tax rates +if ($shipping_sum > 0 && $num_of_tax_rates > 1) { + $display_shipping = ''; + $display_tax_rate = ''; + $colspan_summary_l = 6; + $colspan_summary_m = 5; + $colspan_summary_s = 4; + $colspan_invoice_l = 7; + $colspan_invoice_m = 6; + $colspan_invoice_s = 5; +} +// Shipping per item but no tax rates +elseif ($shipping_sum > 0 && $num_of_tax_rates <= 1) { + $display_shipping = ''; + $display_tax_rate = "none"; + $colspan_summary_l = 6; + $colspan_summary_m = 5; + $colspan_summary_s = 4; + $colspan_invoice_l = 6; + $colspan_invoice_m = 5; + $colspan_invoice_s = 4; +} +// No shipping per item but tax rates +elseif ($shipping_sum <= 0 && $num_of_tax_rates > 1) { + $display_shipping = "none"; + $display_tax_rate = ''; + $colspan_summary_l = 5; + $colspan_summary_m = 4; + $colspan_summary_s = 3; + $colspan_invoice_l = 6; + $colspan_invoice_m = 5; + $colspan_invoice_s = 4; +} +// No shipping per item and no tax rates +else { + $display_shipping = "none"; + $display_tax_rate = "none"; + $colspan_summary_l = 5; + $colspan_summary_m = 4; + $colspan_summary_s = 3; + $colspan_invoice_l = 5; + $colspan_invoice_m = 4; + $colspan_invoice_s = 3; +} + +// Make summary table header for screen using template file +$tpl_so->set_file('summary_table_header', 'table_header.htm'); +$tpl_so->set_var(array( + 'TXT_SKU' => $MOD_BAKERY['TXT_SKU'], + 'TXT_NAME' => $MOD_BAKERY['TXT_NAME'], + 'TXT_QUANTITY' => $MOD_BAKERY['TXT_QUANTITY'], + 'TXT_PRICE' => $MOD_BAKERY['TXT_PRICE'], + 'SETTING_SHOP_CURRENCY' => $setting_shop_currency, + 'DISPLAY_SHIPPING' => $display_shipping, + 'TXT_SHIPPING' => $MOD_BAKERY['TXT_SHIPPING'], + 'TXT_SUM' => $MOD_BAKERY['TXT_SUM'], + 'COLSPAN_L' => $colspan_summary_l +)); +$tpl_so->pparse('output', 'summary_table_header'); + +// Make invoice table header for invoice print using template file +$tpl_ip->set_file('invoice_table_header', 'table_header.htm'); +$tpl_ip->set_var(array( + 'TXT_SKU' => $MOD_BAKERY['TXT_SKU'], + 'TXT_NAME' => $MOD_BAKERY['TXT_NAME'], + 'TXT_QUANTITY' => $MOD_BAKERY['TXT_QUANTITY'], + 'TXT_PRICE' => $MOD_BAKERY['TXT_PRICE'], + 'SETTING_SHOP_CURRENCY' => $setting_shop_currency, + 'DISPLAY_SHIPPING' => $display_shipping, + 'TXT_SHIPPING' => $MOD_BAKERY['TXT_SHIPPING'], + 'DISPLAY_TAX_RATE' => $display_tax_rate, + 'TXT_TAX' => $MOD_BAKERY['TXT_TAX'], + 'TXT_SUM' => $MOD_BAKERY['TXT_SUM'], + 'COLSPAN_L' => $colspan_invoice_l +)); +$tpl_ip->parse('invoice_print', 'invoice_table_header', true); + + +// Initialize vars +$count_items = 0; +$order_subtotal = 0; +$item_shipping_subtotal = 0; +$order_total = 0; +$email_item_list = ''; + + +// LOOP THROUGH ITEMS +for ($i = 1; $i <= sizeof($items); $i++) { + + // Calculate order subtotal and shipping per item subtotal (w/o tax and general shipping) + if ($shipping_sum > 0) { + $f_price = number_format($items[$i]['price'], 2, $setting_dec_point, $setting_thousands_sep); + $f_shipping = number_format($items[$i]['shipping'], 2, $setting_dec_point, $setting_thousands_sep); + // See http://www.bakery-shop.ch/#shipping_total + // $item_total = $items[$i]['quantity'] * ($items[$i]['price'] + $items[$i]['shipping']); + $item_total = $items[$i]['quantity'] * $items[$i]['price']; + $item_shipping = $items[$i]['quantity'] * $items[$i]['shipping']; + $f_total = number_format($item_total, 2, $setting_dec_point, $setting_thousands_sep); + $order_subtotal = $order_subtotal + $item_total; + $item_shipping_subtotal = $item_shipping_subtotal + $item_shipping; + $f_order_subtotal = number_format($order_subtotal, 2, $setting_dec_point, $setting_thousands_sep); + } + // Calculate order subtotal without shipping per item (w/o tax and general shipping) + else { + $f_price = number_format($items[$i]['price'], 2, $setting_dec_point, $setting_thousands_sep); + $f_shipping = 0; + $item_total = $items[$i]['quantity'] * $items[$i]['price']; + $f_total = number_format($item_total, 2, $setting_dec_point, $setting_thousands_sep); + $order_subtotal = $order_subtotal + $item_total; + $f_order_subtotal = number_format($order_subtotal, 2, $setting_dec_point, $setting_thousands_sep); + } + + // Count number of items for shipping per item + $count_items += $items[$i]['quantity']; + + // Make table of ordered items for screen output using template file + $tpl_so->set_file('summary_table_body', 'table_body.htm'); + $tpl_so->set_var(array( + 'SKU' => $items[$i]['sku'], + 'NAME' => $items[$i]['name'], + 'ATTRIBUTE' => $items[$i]['html_show_attribute'], + 'DESCRIPTION' => $items[$i]['description'], + 'QUANTITY' => $items[$i]['quantity'], + 'PRICE' => $f_price, + 'DISPLAY_SHIPPING' => $display_shipping, + 'SHIPPING' => $f_shipping, + 'TOTAL' => $f_total + )); + $tpl_so->parse('screen_output', 'summary_table_body', true); + + // Make table of ordered items for invoice print using template file + $tpl_ip->set_file('invoice_table_body', 'table_body.htm'); + $tpl_ip->set_var(array( + 'SKU' => $items[$i]['sku'], + 'NAME' => $items[$i]['name'], + 'ATTRIBUTE' => $items[$i]['html_show_attribute'], + 'DESCRIPTION' => $items[$i]['description'], + 'QUANTITY' => $items[$i]['quantity'], + 'PRICE' => $f_price, + 'DISPLAY_SHIPPING' => $display_shipping, + 'SHIPPING' => $f_shipping, + 'DISPLAY_TAX_RATE' => $display_tax_rate, + 'ITEM_TAX_RATE' => number_format($items[$i]['tax_rate'], 1), + 'TOTAL' => $f_total + )); + $tpl_ip->parse('invoice_print', 'invoice_table_body', true); + + // Make list of ordered items for email with shipping per item + // Do not change text indent since it fits to the email + if ($shipping_sum > 0) { + $email_item_list .= " + {$MOD_BAKERY['TXT_SKU']}: {$items[$i]['sku']} + {$MOD_BAKERY['TXT_NAME']}: {$items[$i]['name']}{$items[$i]['email_show_attribute']} + {$MOD_BAKERY['TXT_QUANTITY']}: {$items[$i]['quantity']} + {$MOD_BAKERY['TXT_PRICE']}: $setting_shop_currency $f_price + {$MOD_BAKERY['TXT_SHIPPING']}: $setting_shop_currency $f_shipping + {$MOD_BAKERY['TXT_SUM']}: $setting_shop_currency $f_total\n"; + } + // Make list of ordered items for email without shipping per item + // Do not change text indent since it fits to the email + else { + $email_item_list .= " + {$MOD_BAKERY['TXT_SKU']}: {$items[$i]['sku']} + {$MOD_BAKERY['TXT_NAME']}: {$items[$i]['name']}{$items[$i]['email_show_attribute']} + {$MOD_BAKERY['TXT_QUANTITY']}: {$items[$i]['quantity']} + {$MOD_BAKERY['TXT_PRICE']}: $setting_shop_currency $f_price + {$MOD_BAKERY['TXT_SUM']}: $setting_shop_currency $f_total\n"; + } +} + + + +// CALCULATE SHIPPING +// ****************** + +// Select the shipping cost-effective country +$effective_country = $_SESSION['bakery']['ship_data'] ? $ship_country : $cust_country; + +// Select shipping rate +if ($effective_country == $setting_shop_country) { + $setting_shipping_rate = $setting_shipping_domestic; +} +elseif (in_array($effective_country, $setting_zone_countries)) { + $setting_shipping_rate = $setting_shipping_zone; +} +else { + $setting_shipping_rate = $setting_shipping_abroad; +} + +// Calculate shipping +if ($setting_shipping_method == "highest") { + // Determine highest shipping per item of all items specified + $highest_shipping = $shipping_array; + rsort($highest_shipping, SORT_NUMERIC); + $shipping = $highest_shipping[0]; +} else { + // Determine shipping and add shipping per item subtotal + if ($setting_shipping_method == "flat") { + $shipping = $setting_shipping_rate; + } + elseif ($setting_shipping_method == "items") { + $shipping = $setting_shipping_rate * $count_items; + } + elseif ($setting_shipping_method == "positions") { + $shipping = $setting_shipping_rate * sizeof($items); + } + elseif ($setting_shipping_method == "percentage") { + $shipping = $order_subtotal / 100 * $setting_shipping_rate; + } + else { + $shipping = 0; + } + $shipping = $shipping + $item_shipping_subtotal; // See http://www.bakery-shop.ch/#shipping_total +} + +// Text normal shipping +$txt_shipping_cost = $MOD_BAKERY['TXT_SHIPPING_COST']; +$css_class_cart_shipping_f = "mod_bakery_cart_shipping_f"; +$css_class_invoice_shipping_b = "mod_bakery_invoice_shipping_b"; + +// Free shipping for larger amounts +if ($order_subtotal >= $setting_free_shipping) { + $shipping = 0; + // Text free shipping + $txt_shipping_cost = $MOD_BAKERY['TXT_FREE_SHIPPING']; + $css_class_cart_shipping_f = "mod_bakery_cart_free_shipping_f"; + $css_class_invoice_shipping_b = "mod_bakery_invoice_free_shipping_b"; +} else { + // If no free shipping and shipping tax rate is not 0, add shipping tax rate to the tax rates array + if ($setting_tax_rate_shipping != 0) { + $f_tax_rate_array[] = number_format($setting_tax_rate_shipping, 1); + } +} + +// Format shipping for display +$f_shipping = number_format($shipping, 2, $setting_dec_point, $setting_thousands_sep); + +// Inform customers about free shipping limit using template file +if ($setting_free_shipping_msg == "show" && $setting_free_shipping > 0 && $order_subtotal < $setting_free_shipping) { + $tpl_so->set_file('summary_free_shipping', 'free_shipping.htm'); + $tpl_so->set_var(array( + 'TXT_FREE_SHIPPING' => $MOD_BAKERY['TXT_FREE_SHIPPING'], + 'TXT_OVER' => $MOD_BAKERY['TXT_OVER'], + 'SETTING_SHOP_CURRENCY' => $setting_shop_currency, + 'SETTING_FREE_SHIPPING' => $setting_free_shipping + )); + $tpl_so->pparse('output', 'summary_free_shipping'); +} + + + +// CALCULATE SHIPPING SALES TAX +// **************************** + +// Calculate tax amount for shipping including tax (brutto) +if ($setting_tax_included == 'included') { + $sales_tax_shipping = $shipping * $setting_tax_rate_shipping / (100 + $setting_tax_rate_shipping); +} +else { + // Calculate tax amount for shipping excluding tax (netto) + $sales_tax_shipping = $shipping / 100 * $setting_tax_rate_shipping; +} + + + +// CHECK IF WE HAVE TO PAY SALES TAX +// ********************************* + +// Initialize var +$pay_sales_tax = false; + +// Sales tax depending on country +if ($setting_tax_by == 'country') { + + // Special handling for EU tax zone according to EU law + // http://www.websitebaker2.org/forum/index.php/topic,21690.msg145849.html + if (strpos($setting_tax_group, $setting_shop_country) !== false && + strpos($setting_tax_group, $cust_country) !== false) { + if ($cust_tax_no == '') { + $pay_sales_tax = true; + } + } + + // All other countries + else { + if ($cust_country == $setting_shop_country) { + $pay_sales_tax = true; + } + } +} + +// Sales tax depending on state +elseif ($setting_tax_by == 'state') { + if ($cust_state_code == $setting_shop_state) { + $pay_sales_tax = true; + } +} + + + +// CALCULATE TOTAL +// *************** + +// Convert tax rate array into string for displaying +$f_tax_rate = '0%'; +if (count($f_tax_rate_array) > 0) { + $f_tax_rate_array = array_unique($f_tax_rate_array); + $f_tax_rate = implode(' / ', $f_tax_rate_array).'%'; +} + +// Total item and shipping sales tax +$sales_tax = $sales_tax + $sales_tax_shipping; + + +// Calculate total dependig on settings and sales tax +// Setting no sales tax +if ($setting_tax_by == 'none') { + $order_total = $order_subtotal + $shipping; +} +// Prices sales tax included +elseif ($setting_tax_included == 'included') { + if ($pay_sales_tax) { + $order_total = $order_subtotal + $shipping; + } else { + $sales_tax = $sales_tax * -1; + $order_total = $order_subtotal + $sales_tax + $shipping; + $MOD_BAKERY['TXT_INCL'] = '- '; + } +} +// Prices sales tax not included +else { + if ($pay_sales_tax) { + $order_total = $order_subtotal + $sales_tax + $shipping; + } else { + $order_total = $order_subtotal + $shipping; + $f_tax_rate = '0%'; + $sales_tax = 0; + } + $MOD_BAKERY['TXT_INCL'] = ''; +} + +// Format output for display +$f_sales_tax = number_format($sales_tax, 2, $setting_dec_point, $setting_thousands_sep); +$f_order_total = number_format($order_total, 2, $setting_dec_point, $setting_thousands_sep); +// Put rounded order total into the session var for later use with payment gateways +$_SESSION['bakery']['order_total'] = round($order_total, 2); + +// Write shipping fee and sales tax into db +$database->query("UPDATE ".TABLE_PREFIX."mod_bakery_customer SET shipping_fee = '$f_shipping', sales_tax = '$f_sales_tax' WHERE order_id='{$_SESSION['bakery']['order_id']}'"); + + + +// IF NEEDED ADD HIDDEN PAYMENT GATEWAY POST DATA +// ********************************************** + +// Include info file +if (file_exists(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/info.php')) { + include(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/info.php'); +} + +// Get checkout url for either onsite payment method or payment gateway +$checkout_url = isset($payment_gateway_url) ? $payment_gateway_url : $setting_continue_url; + +// Get hidden gateway data +$pay_gateway_data = ''; +if (is_file(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/post_data.php')) { + include(WB_PATH.'/modules/bakery/payment_methods/'.$payment_method.'/post_data.php'); +} + + + +// VIEW TABLE OF SALES TAX, SHIPPING, ORDER TOTAL AND DISPLAY BUTTONS +// ****************************************************************** + +// Depending on general settings show/hide sales taxes +$display_tax = $setting_tax_by == 'none' ? 'none' : ''; + +// Make table of sales tax, shipping, order total and buttons for screen output using template file +$tpl_so->set_file('summary_table_footer', 'table_footer.htm'); +$tpl_so->set_var(array( + 'COLSPAN_L' => $colspan_summary_l, + 'COLSPAN_M' => $colspan_summary_m, + 'COLSPAN_S' => $colspan_summary_s, + 'TXT_SUBTOTAL' => $MOD_BAKERY['TXT_SUBTOTAL'], + 'SETTING_SHOP_CURRENCY' => $setting_shop_currency, + 'ORDER_SUBTOTAL' => $f_order_subtotal, + 'CSS_CLASS_CART_SHIPPING' => $css_class_cart_shipping_f, + 'TXT_SHIPPING_COST' => $txt_shipping_cost, + 'SHIPPING' => $f_shipping, + 'DISPLAY_TAX' => $display_tax, + 'TXT_INCL' => $MOD_BAKERY['TXT_INCL'], + 'TAX_RATE' => $f_tax_rate, + 'TXT_TAX' => $MOD_BAKERY['TXT_TAX'], + 'SALES_TAX' => $f_sales_tax, + 'TXT_TOTAL' => $MOD_BAKERY['TXT_TOTAL'], + 'ORDER_TOTAL' => $f_order_total, + 'SETTING_CONTINUE_URL' => $setting_continue_url, + 'TXT_CONTINUE_SHOPPING' => $MOD_BAKERY['TXT_CONTINUE_SHOPPING'], + 'TXT_CANCEL_ORDER' => $MOD_BAKERY['TXT_CANCEL_ORDER'], + 'TXT_JS_CONFIRM' => $MOD_BAKERY['TXT_JS_CONFIRM'], + 'CHECKOUT_URL' => $checkout_url, + 'PAY_GATEWAY_DATA' => $pay_gateway_data, + 'TXT_SUBMIT_ORDER' => $MOD_BAKERY['TXT_SUBMIT_ORDER'], + 'TXT_BUY' => $MOD_BAKERY['TXT_BUY'].' '.$setting_shop_currency.' '.$f_order_total +)); +$tpl_so->pparse('screen_output', 'summary_table_footer', true); + + + +// Make table of sales tax, shipping and order total for invoice print using template file +$tpl_ip->set_file('invoice_table_footer', 'table_footer.htm'); +$tpl_ip->set_var(array( + 'COLSPAN_L' => $colspan_invoice_l, + 'COLSPAN_M' => $colspan_invoice_m, + 'COLSPAN_S' => $colspan_invoice_s, + 'TXT_SUBTOTAL' => $MOD_BAKERY['TXT_SUBTOTAL'], + 'SETTING_SHOP_CURRENCY' => $setting_shop_currency, + 'ORDER_SUBTOTAL' => $f_order_subtotal, + 'CSS_CLASS_INVOICE_SHIPPING'=> $css_class_invoice_shipping_b, + 'TXT_SHIPPING_COST' => $txt_shipping_cost, + 'SHIPPING' => $f_shipping, + 'DISPLAY_TAX' => $display_tax, + 'TXT_INCL' => $MOD_BAKERY['TXT_INCL'], + 'TAX_RATE' => $f_tax_rate, + 'TXT_TAX' => $MOD_BAKERY['TXT_TAX'], + 'SALES_TAX' => $f_sales_tax, + 'TXT_TOTAL' => $MOD_BAKERY['TXT_TOTAL'], + 'ORDER_TOTAL' => $f_order_total +)); +$tpl_ip->parse('invoice_print', 'invoice_table_footer', true); + +// Save invoice print in a var to store it in the db later on +$invoice_item_list = $tpl_ip->get('invoice_print'); + + + // Make list of sales tax, shipping and order total for the email + // Do not change text indent since it fits to the email + $email_setting_tax_by = $setting_tax_by == "none" ? '' : "\n\t{$MOD_BAKERY['TXT_INCL']} $f_tax_rate {$MOD_BAKERY['TXT_TAX']}: $setting_shop_currency $f_sales_tax"; + $email_item_list .= " + ------------------------------------- + {$MOD_BAKERY['TXT_SUBTOTAL']}: $setting_shop_currency $f_order_subtotal + $txt_shipping_cost: $setting_shop_currency $f_shipping $email_setting_tax_by + ------------------------------------- + ------------------------------------- + {$MOD_BAKERY['TXT_TOTAL']}: $setting_shop_currency $f_order_total + -------------------------------------"; + + + +// PREPARE ORDER DATA FOR PAYMENT GATEWAYS, EMAIL AND INVOICE +// ********************************************************** + +// Get order date from db for invoice and make readable form +$query_customer = $database->query("SELECT order_date FROM ".TABLE_PREFIX."mod_bakery_customer WHERE order_id = '{$_SESSION['bakery']['order_id']}'"); +if ($query_customer->numRows() > 0) { + $customer = $query_customer->fetchRow(); + $order_date = gmdate(DEFAULT_DATE_FORMAT.', '.DEFAULT_TIME_FORMAT, $customer['order_date']+TIMEZONE); +} + +// Get bank account from db for invoice +$query_invoice = $database->query("SELECT value_1 FROM ".TABLE_PREFIX."mod_bakery_payment_methods WHERE directory = 'invoice'"); +if ($query_invoice->numRows() > 0) { + $invoice = $query_invoice->fetchRow(); + $bank_account = stripslashes($invoice['value_1']); +} + +// Make string of invoice data and email data to store in db +$invoice_array = array($order_id, $setting_shop_name, $bank_account, $cust_name, $address, $cust_address, $ship_address, $cust_email, $invoice_item_list, $order_date, $setting_shop_email, $email_address, $email_cust_address, $email_ship_address, $email_item_list, $cust_tax_no, $cust_msg); +$invoice_str = addslashes(implode("&&&&&", $invoice_array)); + +// Write invoice data and email data string into db +$database->query("UPDATE ".TABLE_PREFIX."mod_bakery_customer SET invoice = '$invoice_str' WHERE order_id = '{$_SESSION['bakery']['order_id']}'"); + + + + +// Code below is deprecated and stoped droplets working (only used for WB < 2.8.1) +if (version_compare(WB_VERSION, '2.8.1') < 0) { + + // AVOID OUTPUT FILTER + // Obtain the settings of the output filter module + if (file_exists(WB_PATH.'/modules/output_filter/filter-routines.php')) { + include_once(WB_PATH.'/modules/output_filter/filter-routines.php'); + if (function_exists('getOutputFilterSettings')) { + $filter_settings = getOutputFilterSettings(); + } else { + $filter_settings = get_output_filter_settings(); + } + } else { + // No output filter used, define default settings + $filter_settings['email_filter'] = 0; + } + + // NOTE: + // With ob_end_flush() the output filter will be disabled for Bakery the summary page + // If you are using e.g. ob_start in the index.php of your template it is possible that you will indicate problems + if ($filter_settings['email_filter'] && !($filter_settings['at_replacement']=='@' && $filter_settings['dot_replacement']=='.')) { + ob_end_flush(); + } +}