0vote

Hello,

I sell products as an affiliate and would like to use Sellvana to post a link to the product on a different website rather than have the add to cart button. How do I do this?

I suggest having a product type box so that users can select the product type as digital/downloadable, affiliate product, etc. When I select digital/downloadable product, buyers only get the link after payment/placing order. When I select affiliate product, I input the link in a textbox so that once the buyer visits the product page, they click the buy now button and get redirected to a different site.

Can someone help build a module/extension to bring this functionality?

1 Answer

0vote

Hi, thank you for your question.

We are looking to implement downloadable and custom product types after public beta.

There are quite a few ways of implementing it, but I think this one is the simplest:

  1. Create a custom yes/no product field "Is Externally Linked?" (is_ext_linked)
  2. Most likely you're going to override the default template for product details and grid, so in your custom templates, add a condition that checks for this custom field value and shows a link instead of button form:
    {% if product.get('is_ext_linked') %}
    <Your link HTML here />
    {% else %}
    <Add to cart button form HTML here />
    {% endif %}

Here's an example of your custom module:
local/Ziva/Custom/manifest.yml:

modules:
    Ziva_Custom:
        version: 0.1.0
        require: { module: { Sellvana_Catalog: 0.5.0.0 } }
        auto_use: [ views ]

Custom product details page:
local/Ziva/Custom/Frontend/views/catalog/product/details.html.twig

Custom product grid tiles:
local/Ziva/Custom/Frontend/views/catalog/product/grid-tiles.html.twig

Do not forget to enable your custom module by going to Admin > Modules > Installed modules and setting your module Run level to REQUESTED

Hope this helps,
Boris.

...