Plugin Directory

Changeset 2552677


Ignore:
Timestamp:
06/23/2021 12:13:20 PM (5 years ago)
Author:
appmaxplataforma
Message:

Adicionando validação que checa se o produto possui SKU registrado na loja antes de enviar o carrinho; Subindo banners.

Location:
appmax-woocommerce
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • appmax-woocommerce/trunk/appmax-woocommerce.php

    r2533270 r2552677  
    33 * Plugin Name: AppMax WooCommerce
    44 * Description: Gateway de pagamento AppMax para WooCommerce.
    5  * Version: 2.0.39
     5 * Version: 2.0.40
    66 * License: GPLv2 or later
    77 * Author: AppMax Plataforma de Vendas Ltda
     
    2424    class AppMax_WC
    2525    {
    26         const VERSION = '2.0.39';
     26        const VERSION = '2.0.40';
    2727
    2828        /**
  • appmax-woocommerce/trunk/includes/class-awc-api.php

    r2529290 r2552677  
    241241     * @param $interest
    242242     * @return array
     243     * @throws Exception
    243244     */
    244245    private function awc_get_products_cart( $interest )
     
    336337    private function awc_get_information_product_variation( $skuParentProduct, $values )
    337338    {
    338         $variation = wc_get_product($values['variation_id']);
     339        $variation = wc_get_product( $values['variation_id'] );
    339340
    340341        return [
     
    368369     * @param $values
    369370     * @return array
     371     * @throws Exception
    370372     */
    371373    private function awc_get_current_product( $values )
     
    373375        $product = wc_get_product( $values['product_id'] );
    374376
    375         if (empty($values['variation_id']) && count($values['variation']) == 0) {
     377        if ( ! $product->get_sku() ) {
     378            throw new \Exception( "Produto do carrinho {$product->get_title()} não possui SKU registrado." );
     379        }
     380
     381        if ( empty( $values['variation_id'] ) && count( $values['variation'] ) == 0 ) {
    376382            return $this->awc_get_information_product( $product, $values );
    377383        }
     
    388394    public function awc_post_tracking_code( $order_id, $tracking_code )
    389395    {
    390         $data = $this->make_tracking_code_body($order_id, $tracking_code);
     396        $data = $this->make_tracking_code_body( $order_id, $tracking_code );
    391397
    392398        return $this->awc_post( $this->awc_get_full_url( AWC_Suffix_Api::AWS_SUFFIX_TRACKING_CODE ), $data );
     
    399405     * @return array
    400406     */
    401     private function make_tracking_code_body($order_id, $tracking_code)
     407    private function make_tracking_code_body( $order_id, $tracking_code )
    402408    {
    403409        return [
  • appmax-woocommerce/trunk/readme.txt

    r2533270 r2552677  
    44Requires at least: 4.0
    55Tested up to: 5.1
    6 Stable tag: 2.0.39
     6Stable tag: 2.0.40
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    117117== Changelog ==
    118118
     119= 2.0.40 =
     120
     121* Validação que checa se o produto da loja tem sku antes de enviar o carrinho.
     122
    119123= 2.0.39 =
    120124
Note: See TracChangeset for help on using the changeset viewer.