Defect #1146

Wrong notification sent in case of rejection third party

Added by Blatti Yves almost 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:09/24/2015
Priority:NormalDue date:
Assignee:Battaglia Marc% Done:

100%

Category:SHOP
Target version:4.4.0
Affected version:4.3.0

Description

Wrong notification sent in case of rejection third party
The content if the "new order" mail.

\joomla\components\com_easysdi_shop\models\order.php

    /**
     * thirdpartyRejection - rejection of an order by a thirdparty
     * 
     * @param integer $id
     * @param mixed $reason - defined as optional but $reason have to be set !
     * @return boolean
     * @since 4.3.0
     */
    public function thirdpartyRejection($id, $reason=null){
        $id = (!empty($id)) ? $id : (int) $this->getState('order.id');
        $table = $this->getTable();
        if(!$table->load($id) || is_null($reason)){
            return false;
        }

        $table->orderstate_id = Easysdi_shopHelper::ORDERSTATE_REJECTED;
        $table->validated = false;
        $table->validated_date = date('Y-m-d H:i:s');
        $table->validated_reason = $reason;

        if(($orderStored = $table->store()) === true){
            $db = JFactory::getDbo();
            $query = $db->getQuery(true)
                    ->update('#__sdi_order_diffusion')
                    ->set('productstate_id='.Easysdi_shopHelper::PRODUCTSTATE_REJECTED_TP)
                    ->where('order_id = ' . (int)$id);
            $db->setQuery($query);
            $db->execute();

            // Notify customer
            Easysdi_shopHelper::notifyCustomer($table->name);
        }

        return $orderStored;
    }


Related issues

Related to easySDI - Enhancement #1148: SHOP enhance mail notifications Closed 09/24/2015

History

#1 Updated by Blatti Yves over 3 years ago

#2 Updated by Blatti Yves over 3 years ago

  • % Done changed from 0 to 100

rev 9383

#3 Updated by Blatti Yves over 3 years ago

  • Status changed from Affected to Resolved

#4 Updated by Blatti Yves over 3 years ago

  • Target version set to 4.4.0

#5 Updated by Blatti Yves over 3 years ago

  • Status changed from Resolved to To merge

#6 Updated by Blatti Yves over 3 years ago

  • Assignee changed from Blatti Yves to Battaglia Marc

#7 Updated by Battaglia Marc over 3 years ago

  • Status changed from To merge to Closed

Also available in: Atom PDF