Jump to content

Gift Cerificate not being sent


kalyncomputers
 Share

Recommended Posts

Hi,

I have a client with a CC store and we have just discovered that if someone buys a Gift Certificate, the recipient does not get it or a download link. I have tested it and can place an order, pay for it and the store owner gets the payment and notification of the sale but the actual GC does not arrive anywhere.

The store is running the latest CC 6, Foundation skin, no mods and everything else works perfectly.

Any ideas?

Thanks

 

Tim

Link to comment
Share on other sites

I am seeing the code in the Order class where, if the admin has the setting in Store Settings, Features tab, "Force Order Completed Emails" is OFF, then when CubeCart moves an order to Processing and that order is eligible to be automatically moved to Completed (as for a 'digital-only' order), then CubeCart will not send emails when that order does move to Completed. This includes not sending the email with the Gift Cert (Order->_sendCoupon), but does not include not sending download links for digital inventory.

I cannot guess the reasoning for this programming decision.

Can you let us know what the setting is in admin?

I would try:

In order.class.php, near lines 462-473, find:
    // Load up the inventory, if we haven't already
    if (!isset($complete)) {
        $this->_getInventory($order_id);
    }
    if (!$this->_skip_order_complete_email && $this->_email_enabled) {
        foreach ($this->_order_inventory as $item) {
            // Send Gift Certificate
            if (!empty($item['custom']) && !empty($item['coupon_id'])) {
                $this->_sendCoupon($item['coupon_id'], unserialize($item['custom']));
            }
        }
    }

MOVE the above lines of code to a spot just after line 441:
    // Send digital files
    $this->_digitalDelivery($order_id, $this->_order_summary['email']);
/* PUT THE MOVED CODE HERE */
    break;

Then delete these lines, because they are redundant:
	// Load up the inventory, if we haven't already
	if (!isset($complete)) {
		$this->_getInventory($order_id);
	}

Then edit the line from:
if (!$this->_skip_order_complete_email && $this->_email_enabled) {
to:
if ($this->_email_enabled) {

 

Link to comment
Share on other sites

That flag was added to solve some issues with some payment gateways and obviously digital product only orders which move directly to Completed were accounted for but orders that only contain a Gift certificate where it is a digital only delivery weren't.  I am seeing the same behaviour and this is definitely a bug that needs to be fixed and I have reported this as an issue https://github.com/cubecart/v6/issues/764

Ian

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...