0

Can anyone think of a way to achieve this? I want to offer a product that the customer can choose to receive physically or as a download.

I could set this as a custom option but then shipping will still show at checkout if the product hasn't been built as a virtual.

Any way around this?

  • So it's more of a shipping kind of option? Send this product to me or I want to download it? – Sander Mangel Sep 28 '15 at 12:55
  • It's a greetings card. Choose to have us print and send it or receive it as a pdf and print it yourself. I guess it needs to be an option on the product page so user can see price difference (tiered pricing for physical product, 1 set price for virtual) – user3783905 Sep 28 '15 at 13:00
1

I don't have a fully working solution, but I have an idea.
the shipping steps show in the checkout if the method Mage_Sales_Model_Quote::isVirtual.
This method looks like this:

public function isVirtual()
{
    $isVirtual = true;
    $countItems = 0;
    foreach ($this->getItemsCollection() as $_item) {
        /* @var $_item Mage_Sales_Model_Quote_Item */
        if ($_item->isDeleted() || $_item->getParentItemId()) {
            continue;
        }
        $countItems ++;
        if (!$_item->getProduct()->getIsVirtual()) {
            $isVirtual = false;
            break;
        }
    }
    return $countItems == 0 ? false : $isVirtual;
}

this basically checks if you have a product that's not virtual. If there is one then the quote is not virtual.
You can try to change this line:

if (!$_item->getProduct()->getIsVirtual()) { 

to something that fits your needs.
I mean, instead of $_item->getProduct()->getIsVirtual() check if the item has a special custom option that makes it virtual or something like that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.