Hi there,
I've been searching for an answer to my question on the forum, and haven't quite found a solution yet. However, I do apologize if this question is redundant in any way, and if I have missed any documentation or help.
Also, if it's necessary to help, I'm using the "Essentials" version.
Basically what I'm trying to do is cut out the product page from the entire purchasing process. I'm using {loadposition} to load only one product in each article, and each product will require variants. As of now, in the article, it displays the "Show Options" button which then takes them to the product page, which then displays the "Add to Cart" button. My products are so simple in nature, that the product page does not show the customer any new information, except the ability to choose their option/variant. To save the customer time, and to reduce this process, I'm hopeful that I can get the variants to display on the product listing, and that the button would no longer say "Show Options," but would say "Add to Cart" and take them directly to the cart, much like products that don't have variants.
I read another post here on the forum, where you gave this response:
Variants options aren't displayed on the listing of products so if you have products with variants you should indeed have the user go in the product page so that he can select the variant before adding to the cart.
I understand what you want to do but we wanted to avoid loading all the variants data with all the processing behind for each product of the listing because if you start having a lot of products displayed and a lot of variants for each, it's just too much. So we decided to just do it on the product page. It's not really a bug, that's just the way it is.
This makes sense to me, especially if you are loading many products on one page, but like I mentioned, I will only ever have one product on one page. And I understand based on your response above, that what I'm asking for seems to go against the grain of HikaShop, but I'm extremely hopeful you can help me achieve a solution.
A couple of theories I have are below, but honestly, I'm no PHP expert so I don't know if this is even possible.
1) Display the product page in the {loadposition} rather than the product listing. (Because both the product listing and product page have the exact same info except the variants & quantity, it makes sense logically to me, to remove the product listing from the entire process, instead of the product page).
2) Rework what the module displays. For instance, there are options in the module to display Random Items, 'Add to Cart' button, Link to product page, and Display price. Could we have an option to display variants? If this is possible, could we change the "Show Options" button to "Add to Cart" and direct to the cart, rather than the product page? I understand this would take quite a bit of code rework, and my guess for a place to start would be to change/add these things:
- Add something like this to the modules/zzparams.php view, perhaps?
<td>
<?php echo $this->orderType->display($this->control.'[characteristics]',$this->characteristics,'product');?>
</td>
- Add something like this to the product listing view:
<?php
}
if(!empty($this->element->characteristics)){
?><span id="hikashop_product_characteristics" class="hikashop_product_characteristics"><?php
echo $this->characteristic->displayFE($this->element,$this->params);
?></span><br /><?php
}
$form = '';
?>
- Somehow change the "Show Options" text and destination?? Not sure where to do this.
Obviously, these are my wild guesses, but I honestly have no idea where to start and how much I'm asking really requires. If possible, could you detail what code needs to be added or changed to make this possible? I'd really appreciate it!
Thanks for all of your hard work -- your product is amazing!