Changeset 1487906
- Timestamp:
- 09/01/2016 09:48:09 AM (10 years ago)
- Location:
- zibbra/trunk
- Files:
-
- 10 edited
-
css/bpost.css (modified) (1 diff)
-
jscripts/bpost.js (modified) (1 diff)
-
jscripts/jquery.zoom.min.js (modified) (1 diff)
-
jscripts/payment.js (modified) (2 diffs)
-
modules/checkout.php (modified) (3 diffs)
-
modules/payment.php (modified) (2 diffs)
-
modules/shipping.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
templates/shipping-bpost.php (modified) (1 diff)
-
zibbra.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zibbra/trunk/css/bpost.css
r1474412 r1487906 1 # bpost_frontend_frame {1 #shmFrame { 2 2 3 3 float: left; -
zibbra/trunk/jscripts/bpost.js
r1474412 r1487906 45 45 method: "post", 46 46 action: this._uri, 47 target: " bpost_frontend_frame"47 target: "shmFrame" 48 48 }); 49 49 -
zibbra/trunk/jscripts/jquery.zoom.min.js
r1308807 r1487906 1 1 /*! 2 Zoom v1.7.13 - 2014-04-29 3 Enlarge images on click or mouseover. 4 (c) 2014 Jack Moore - http://www.jacklmoore.com/zoom 5 license: http://www.opensource.org/licenses/mit-license.php 6 */ 7 (function(o){var t={url:!1,callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,onZoomIn:!1,onZoomOut:!1,magnify:1};o.zoom=function(t,n,e,i){var u,c,a,m,l,r,s,f=o(t).css("position"),h=o(n);return t.style.position=/(absolute|fixed)/.test(f)?f:"relative",t.style.overflow="hidden",e.style.width=e.style.height="",o(e).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:e.width*i,height:e.height*i,border:"none",maxWidth:"none",maxHeight:"none"}).appendTo(t),{init:function(){c=o(t).outerWidth(),u=o(t).outerHeight(),n===t?(m=c,a=u):(m=h.outerWidth(),a=h.outerHeight()),l=(e.width-c)/m,r=(e.height-u)/a,s=h.offset()},move:function(o){var t=o.pageX-s.left,n=o.pageY-s.top;n=Math.max(Math.min(n,a),0),t=Math.max(Math.min(t,m),0),e.style.left=t*-l+"px",e.style.top=n*-r+"px"}}},o.fn.zoom=function(n){return this.each(function(){var e,i=o.extend({},t,n||{}),u=i.target||this,c=this,a=o(c),m=document.createElement("img"),l=o(m),r="mousemove.zoom",s=!1,f=!1;(i.url||(e=a.find("img"),e[0]&&(i.url=e.data("src")||e.attr("src")),i.url))&&(function(){var o=u.style.position,t=u.style.overflow;a.one("zoom.destroy",function(){a.off(".zoom"),u.style.position=o,u.style.overflow=t,l.remove()})}(),m.onload=function(){function t(t){e.init(),e.move(t),l.stop().fadeTo(o.support.opacity?i.duration:0,1,o.isFunction(i.onZoomIn)?i.onZoomIn.call(m):!1)}function n(){l.stop().fadeTo(i.duration,0,o.isFunction(i.onZoomOut)?i.onZoomOut.call(m):!1)}var e=o.zoom(u,c,m,i.magnify);"grab"===i.on?a.on("mousedown.zoom",function(i){1===i.which&&(o(document).one("mouseup.zoom",function(){n(),o(document).off(r,e.move)}),t(i),o(document).on(r,e.move),i.preventDefault())}):"click"===i.on?a.on("click.zoom",function(i){return s?void 0:(s=!0,t(i),o(document).on(r,e.move),o(document).one("click.zoom",function(){n(),s=!1,o(document).off(r,e.move)}),!1)}):"toggle"===i.on?a.on("click.zoom",function(o){s?n():t(o),s=!s}):"mouseover"===i.on&&(e.init(),a.on("mouseenter.zoom",t).on("mouseleave.zoom",n).on(r,e.move)),i.touch&&a.on("touchstart.zoom",function(o){o.preventDefault(),f?(f=!1,n()):(f=!0,t(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0]))}).on("touchmove.zoom",function(o){o.preventDefault(),e.move(o.originalEvent.touches[0]||o.originalEvent.changedTouches[0])}),o.isFunction(i.callback)&&i.callback.call(m)},m.src=i.url)})},o.fn.zoom.defaults=t})(window.jQuery); 2 Zoom 1.7.15 3 license: MIT 4 http://www.jacklmoore.com/zoom 5 */ 6 (function($){var defaults={url:false,callback:false,target:false,duration:120,on:"mouseover",touch:true,onZoomIn:false,onZoomOut:false,magnify:1};$.zoom=function(target,source,img,magnify){var targetHeight,targetWidth,sourceHeight,sourceWidth,xRatio,yRatio,offset,$target=$(target),position=$target.css("position"),$source=$(source);$target.css("position",/(absolute|fixed)/.test(position)?position:"relative");$target.css("overflow","hidden");img.style.width=img.style.height="";$(img).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:img.width*magnify,height:img.height*magnify,border:"none",maxWidth:"none",maxHeight:"none"}).appendTo(target);return{init:function(){targetWidth=$target.outerWidth();targetHeight=$target.outerHeight();if(source===$target[0]){sourceWidth=targetWidth;sourceHeight=targetHeight}else{sourceWidth=$source.outerWidth();sourceHeight=$source.outerHeight()}xRatio=(img.width-targetWidth)/sourceWidth;yRatio=(img.height-targetHeight)/sourceHeight;offset=$source.offset()},move:function(e){var left=e.pageX-offset.left,top=e.pageY-offset.top;top=Math.max(Math.min(top,sourceHeight),0);left=Math.max(Math.min(left,sourceWidth),0);img.style.left=left*-xRatio+"px";img.style.top=top*-yRatio+"px"}}};$.fn.zoom=function(options){return this.each(function(){var settings=$.extend({},defaults,options||{}),target=settings.target||this,source=this,$source=$(source),$target=$(target),img=document.createElement("img"),$img=$(img),mousemove="mousemove.zoom",clicked=false,touched=false,$urlElement;if(!settings.url){$urlElement=$source.find("img");if($urlElement[0]){settings.url=$urlElement.data("src")||$urlElement.attr("src")}if(!settings.url){return}}(function(){var position=$target.css("position");var overflow=$target.css("overflow");$source.one("zoom.destroy",function(){$source.off(".zoom");$target.css("position",position);$target.css("overflow",overflow);$img.remove()})})();img.onload=function(){var zoom=$.zoom(target,source,img,settings.magnify);function start(e){zoom.init();zoom.move(e);$img.stop().fadeTo($.support.opacity?settings.duration:0,1,$.isFunction(settings.onZoomIn)?settings.onZoomIn.call(img):false)}function stop(){$img.stop().fadeTo(settings.duration,0,$.isFunction(settings.onZoomOut)?settings.onZoomOut.call(img):false)}if(settings.on==="grab"){$source.on("mousedown.zoom",function(e){if(e.which===1){$(document).one("mouseup.zoom",function(){stop();$(document).off(mousemove,zoom.move)});start(e);$(document).on(mousemove,zoom.move);e.preventDefault()}})}else if(settings.on==="click"){$source.on("click.zoom",function(e){if(clicked){return}else{clicked=true;start(e);$(document).on(mousemove,zoom.move);$(document).one("click.zoom",function(){stop();clicked=false;$(document).off(mousemove,zoom.move)});return false}})}else if(settings.on==="toggle"){$source.on("click.zoom",function(e){if(clicked){stop()}else{start(e)}clicked=!clicked})}else if(settings.on==="mouseover"){zoom.init();$source.on("mouseenter.zoom",start).on("mouseleave.zoom",stop).on(mousemove,zoom.move)}if(settings.touch){$source.on("touchstart.zoom",function(e){e.preventDefault();if(touched){touched=false;stop()}else{touched=true;start(e.originalEvent.touches[0]||e.originalEvent.changedTouches[0])}}).on("touchmove.zoom",function(e){e.preventDefault();zoom.move(e.originalEvent.touches[0]||e.originalEvent.changedTouches[0])}).on("touchend.zoom",function(e){e.preventDefault();if(touched){touched=false;stop()}})}if($.isFunction(settings.callback)){settings.callback.call(img)}};img.src=settings.url})};$.fn.zoom.defaults=defaults})(window.jQuery); -
zibbra/trunk/jscripts/payment.js
r1474412 r1487906 7 7 this._host = null; 8 8 this._countdown = Zibbra.Payment.TIMEOUT; 9 this._loading = false; 10 this._timer = null; 9 11 10 12 }; // end function … … 55 57 $(".progress-bar").attr("aria-valuenow",percentage).css("width",percentage+"%"); 56 58 57 if(( this._countdown% 5) === 0) {59 if((Math.floor(this._countdown) % 5) === 0) { 58 60 59 $.post(zibbra.getAjaxUrl(), data, function(response) {61 if(!this._loading) { 60 62 61 if(response.status === "success" || response.status === "error") {63 this._loading = true; 62 64 63 location.href = response.url;65 $.post(zibbra.getAjaxUrl(), data, function(response) { 64 66 65 } // end if67 if(response.status === "success" || response.status === "error") { 66 68 67 }); // end getJSON 69 clearTimeout(self._timer); 70 71 location.href = response.url; 72 73 } // end if 74 75 self._loading = false; 76 77 }); // end getJSON 78 79 } // end if 68 80 69 81 } // end if 70 82 71 this._countdown -=Zibbra.Payment.DELAY;83 this._countdown = this._countdown - Zibbra.Payment.DELAY; 72 84 73 setTimeout(function() {85 this._timer = setTimeout(function() { 74 86 75 87 self.check(); -
zibbra/trunk/modules/checkout.php
r1478800 r1487906 193 193 194 194 $oPaymentAdapter = false; 195 $oShippingMethod = false; 195 196 $oShippingAdapter = false; 196 197 … … 259 260 $number = $oOrder->getNumber(); 260 261 $amount = $oOrder->getAmountIncl(); 262 263 // Shipping costs 264 265 if(($shipping_cost = $adapter->getSessionValue("shipping.price",false)) !== false) { 266 267 $amount += ($shipping_cost * 1.21); 268 269 }elseif($oShippingMethod instanceof ZShippingMethod) { 270 271 $amount += $oShippingMethod->getPriceVatIncl(); 272 273 } // end if 261 274 262 275 // Load the customer … … 274 287 $oShippingAdapter->dispatch($oCustomer, $oOrder); 275 288 289 } // end if 290 291 // Get the payment adapter 292 293 if($oPaymentAdapter == false && ($payment = $adapter->getSessionValue("payment",false)) !== false) { 294 295 $oPaymentAdapter = ZPayment::get($payment); 296 276 297 } // end if 277 298 -
zibbra/trunk/modules/payment.php
r1474412 r1487906 154 154 $response->url = $this->getReturnUrl(); 155 155 156 }else{ 157 158 $response->status = "pending"; 159 156 160 } // end if 157 161 … … 472 476 473 477 wp_enqueue_style("wp-plugin-zibbra-payment", plugins_url("css/payment.css",ZIBBRA_BASE_DIR."/css")); 474 wp_enqueue_script("wp-plugin-zibbra-payment", plugins_url("jscripts/payment.js",ZIBBRA_BASE_DIR."/jscripts") );478 wp_enqueue_script("wp-plugin-zibbra-payment", plugins_url("jscripts/payment.js",ZIBBRA_BASE_DIR."/jscripts"), $deps = array(), "1.3.7"); 475 479 476 480 // Return template name -
zibbra/trunk/modules/shipping.php
r1474412 r1487906 132 132 */ 133 133 private function onCancel(WP_Query $wp_query) { 134 135 // Get the library adapter 136 137 $adapter = Zibbra_Plugin_Controller::getInstance()->getLibrary()->getAdapter(); 138 139 // Log the request 140 141 $adapter->log(LOG_DEBUG, "shipment|cancel\nGET:".print_r($_GET,true)."POST:".print_r($_POST,true)."SERVER:".print_r($_SERVER,true)); 142 143 // Get the orderid from session 144 145 if(($orderid = $adapter->getSessionValue("order.id",false))!==false) { 146 147 // Clear the order information from session 148 149 $adapter->clearSessionValue("order"); 150 $adapter->clearSessionValue("order.id"); 151 $adapter->clearSessionValue("order.amount"); 152 153 // Cancel the order 154 155 ZOrder::cancel($orderid); 156 157 } // end if 158 159 // Notify the user 160 161 Zibbra_Plugin_Notify::register(Zibbra_Plugin_Notify::STATUS_WARNING, __("Your order has been cancelled", Zibbra_Plugin::LC_DOMAIN)); 162 163 // Redirect to the checkout page 164 165 wp_redirect(site_url("/zibbra/checkout/")); 166 exit; 134 167 135 168 } // end function … … 314 347 $oShippingMethod = $oOrder->getShippingMethod(); 315 348 349 // Get the shipping cost 350 351 $shipping_cost = $adapter->getSessionValue("shipping.price", 0); 352 316 353 // Confirm order with shipping info 317 354 318 ZShippingAdapterBpost::confirm($oOrder, $oShippingMethod->getEnterpriseshippingmethodid(), $ oOrder->getAmountIncl(), $_POST);355 ZShippingAdapterBpost::confirm($oOrder, $oShippingMethod->getEnterpriseshippingmethodid(), $shipping_cost, $_POST); 319 356 320 357 // Update session info & redirect 321 358 322 359 $adapter->setSessionValue("shipping.complete", true); 360 323 361 $uri = site_url("/zibbra/checkout/?continue"); 324 362 echo "<script> window.top.location = '" . $uri . "'; </script>"; -
zibbra/trunk/readme.txt
r1478800 r1487906 4 4 Contributors: Zibbra 5 5 Tags: Ecommerce, Cloud 6 Stable tag: 1.3. 26 Stable tag: 1.3.6 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 51 51 52 52 == Changelog == 53 54 = 1.3.6 = 55 56 * Bugfix shipping costs 57 58 = 1.3.5 = 59 60 * Bugfix Mollie payment validation 61 * Bugfix bpost shipping integration 62 63 = 1.3.4 = 64 65 * Improvement Mollie payment validation 66 67 = 1.3.3 = 68 69 * Bugfixes bpost integration 53 70 54 71 = 1.3.2 = -
zibbra/trunk/templates/shipping-bpost.php
r1474412 r1487906 3 3 defined("ZIBBRA_BASE_DIR") or die("Restricted access"); 4 4 5 //echo "<pre>"; 6 //print_r($bpost_config); 7 //exit; 8 5 9 ?> 6 10 7 <iframe id=" bpost_frontend_frame" name="bpost_frontend_frame"></iframe>11 <iframe id="shmFrame" name="shmFrame" width="790" height="520" style="border:none;"></iframe> 8 12 9 13 <script type="text/javascript"> -
zibbra/trunk/zibbra.php
r1478800 r1487906 6 6 * Plugin URI: http://wordpress.org/plugins/zibbra/ 7 7 * Description: Zibbra integration plugin for Wordpress 8 * Version: 1.3. 28 * Version: 1.3.6 9 9 * Author: Zibbra 10 10 * Author URI: https://www.zibbra.com … … 81 81 const FORM_ACTION = "zibbra"; 82 82 const ROLE = "customer"; 83 const VERSION = "1.3. 2";83 const VERSION = "1.3.6"; 84 84 85 85 private $controller = null;
Note: See TracChangeset
for help on using the changeset viewer.