Wellrad shop modification request

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
gerepeer
Posts: 39
Joined: Fri May 23, 2008 1:21 pm

Wellrad shop modification request

Post by gerepeer » Thu Oct 11, 2012 5:51 pm

Hello CMSimplers,

I`m making a online shop for a friend of mine and wanted to do so with the wellrad plugin but while doing so i encountered some limitations making my quest a little harder unless someone .....
1 when editing a product there is a preview image which is fine but then only one image that will be shown on the detailed product page, I need to be able to put in 3 images, once saved these pictures have to appear on the productdetails.tpl
2 If inserting the image or preview image (edit product) would be nice to have a scale option max width / height for all images to achieve a certain consistency of all images
3 a zoom function to view a larger image of the one appearing on productdetails.tpl here the scale option could be handy.
If someone knows how to do this please let me know and i will try.

Thanks in advance to all for reading this i think it`s a nice adition to the wellrad plugin.

Greetings from spain

Gerepeer

kweku
Posts: 90
Joined: Sun Jan 18, 2009 3:37 pm

Re: Wellrad shop modification request

Post by kweku » Fri Oct 12, 2012 10:19 am

hi,

ive been down the wellrad road before. the best thing i can suggest is to embed a shopping cart like ecwid into your site. its free and has a lot of features.
check ecwid out here. http://www.ecwid.com

here is a site i am working on, embedded within a modified version of cmsimple http://karencodycreative.com.au/?COLLEC ... I_PRECIOUS

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Wellrad shop modification request

Post by cmb » Fri Oct 12, 2012 1:40 pm

Hi gerepeer, hi kweku,
gerepeer wrote:If someone knows how to do this please let me know and i will try.
You can use own detail pages for each product instead of the one created by default. In the product "editor" you have to select the "Product Page" and you have to leave the "Description" empty. As these product pages are normal CMSimple pages, you can lay them out as desired. If you want to have a zoom function, you can use hi_fancybox. For resizing the images on upload you can use Uploader_XH or you can use the automatic thumbnail creation of KCFinder. Manual resizing of images after upload is possible with Ajaxfilemanager_XH.
kweku wrote:the best thing i can suggest is to embed a shopping cart like ecwid into your site. its free and has a lot of features.
One should note that ecwid provides the shop as SAAS. If they're going to suspend or discontinue the service, the shop won't work anymore and probably all data (the items and their description) are lost.

There are other alternatives, e.g. opencart and Quick.Cart (this is no recommendation, but only a hint, as I have no experience with these systems).

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

gerepeer
Posts: 39
Joined: Fri May 23, 2008 1:21 pm

Re: Wellrad shop modification request

Post by gerepeer » Fri Oct 12, 2012 2:23 pm

Hello kweku and Christoph ,

Thank you both for replies, http://karencodycreative.com.au/?COLLEC ... I_PRECIOUS is not just semi precious MUY GUAPA (spanish)
http://www.ecwid.com looks very promising but i can understand cmb`s point of view besides i personally find it a bit slow (traffic back and forth) maybe it`s just my internet connection.
I like cmb`s option of the Product Page, did not think of this before. even though it`s a lot more work it provides solutions to the earlier encountered limitations.
I`ll give it a try.

Thank you both and keep up the good work.

Greetings from Spain,

Gerepeer

Sordon
Posts: 30
Joined: Thu Jun 26, 2008 3:18 pm
Location: Germany

Re: Wellrad shop modification request

Post by Sordon » Thu Oct 18, 2012 3:52 pm

Checkout this shop that was done with Wellrad: http://www.covermover.com/en/?Shop It has some of the features you are looking for. When you look at a detail page you can see that it is possible to enlarge certain picture of the product.
The necessary html code was directly added into the detail description of the Wellrad maintenance backend.

Best Regards,
Sordon

gerepeer
Posts: 39
Joined: Fri May 23, 2008 1:21 pm

Re: Wellrad shop modification request

Post by gerepeer » Fri Nov 02, 2012 2:45 pm

Hello cracks,

The shop is doing more or less what we want and how we wanted Thanks for all help and hints.
I will post a link as soon as it goes live, i only have one more question.
When adding a product to the catalog you can choose between available yes/no if yes the product is visible if no not
i would like to have this product to still be visible but without the order option maybe even with a sold jpg in its place does anybody know how to achieve this.

Thanks in advance,

Gerepeer

Martin
Posts: 346
Joined: Thu Oct 23, 2008 11:57 am
Contact:

Re: Wellrad shop modification request

Post by Martin » Sat Nov 03, 2012 12:05 pm

Hello Gereeper,

you'll have to do two things to achieve this:
  1. open wellrad/classes/app/wrs_frontend_controller.php, search for the function productList() and change the line (~ 562)

    Code: Select all

    $params                       = parent::productList(false); 
    to

    Code: Select all

    $params                       = parent::productList(true); 
    After that all products will be displayed
  2. The next step is changing the templates "catalog.tpl" and "productDetails.tpl". Copy them from wellrad/templates/frontend/ to wellrad/theme/frontend and wrap the the <form>-element that contains the add-to-cart-button into an if-else-statement.

    Code: Select all

    if ($product['isAvailable'])
    {
      // show button
    }
    else {
       // show something else
    }
     
    . In catalog.tpl e.g. it might look like this:

    Code: Select all

    <?php  /* new line: */ if ($product['isAvailable']) { ?>
    <form action="" method="post" >
        <?php if(isset($product['variants'])){ ?> 
        <select name="wrsVariant">
            <?php foreach($product['variants'] as $key => $variant){ ?>
            <option value="<?php echo $key; ?>"><?php echo $variant; ?></option>
            <?php } ?>
        </select>
        <?php } ?>
        <input type="text" size="2" style="display: inline; width: 1.5em;" name="wrsAmount" value="1" />
        <input type="hidden" name="wrsTask" value="updateCart" />
        <input type="hidden" name="wrsCategory" value="<?php echo $this->selectedCategory; ?>" /> x
        <input type="hidden" name="cartItem" value="<?php echo $index; ?>" />
        <input type="submit" class="shopButton" name="" value="<?php echo $this->label('add_to_cart'); ?>" />
    </form>
    <?php /* new line: */ } else { echo 'not available';} ?> 
KR

Martin

gerepeer
Posts: 39
Joined: Fri May 23, 2008 1:21 pm

Re: Wellrad shop modification request

Post by gerepeer » Sat Nov 03, 2012 4:33 pm

Juuhuu..
Thanks Martin works like a charm.

Gerepeer

milkodb
Posts: 47
Joined: Sun Jun 23, 2013 11:00 pm
Location: Italy

Re: Wellrad shop modification request

Post by milkodb » Tue Feb 18, 2014 2:32 am

Hi all,

although much later than the date of the post, as I have had the need to change wellrad in such a way that the products were shown although not available replacing the "quantity/add" block with a "not available" notice , I've first changed "wrs_controller.php" removing:

Code: Select all

if($collectAll === false && $product->isAvailable() === false){continue;}
( or simply commenting "{continue;}" )

Later, looking for any threads on this topic in the forum, I saw that in this post Martin suggested changing wrs_frontend_controller.php

from

Code: Select all

$params = parent::productList(false); 
to

Code: Select all

$params = parent::productList(true); 
I tested the two solutions and both work.


I also have resolved "product.tpl" by an "if... else" condition evaluating the truth of "isAvailable".
But I realized that remained a vexing problem: the parameter "isAvailable" is perfectly functional in "product.tpl" but not correctly returned in "productDetails.tpl." It seems remaining set to the value of the last inserted product.

So I thought I would instead use this parameter reading it directly from the document "catalog.php" in "data" folder which, for each product, once written remains unchanged. Then, for "productDetails.tpl I've set the condition in this way:

Code: Select all

<?php
include WRS_BASE_PATH . 'data/catalog.php';
if($products[$this->uid]['stock_on_hand'] == '1'):
{
  // show button, etc.
}
else {
   // show something else
}
endif;
?>
All is working fine.

I imagine that someone could suggest an alternative solution, however my catalog seems to work without problems:
if a product is no longer available, the "add to cart" buttons are not displayed and replaced by a notice of the unavailability of the product. However, as for orders over a certain amount it's possible to reopen the production on demand (contacting the company directly), the detailed description of the product is shown again but yet without "add to cart" buttons.
Milko

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Wellrad shop modification request

Post by cmb » Wed Feb 19, 2014 3:04 pm

Hi Milko,

thanks for sharing your solution. Apparently, Martin's suggestion doesn't work for productDetails.tpl in the latest Wellrad version (1.2.1).

However, reading catalog.php again doesn't seem to be necessary, as one can access $this->product->stock_on_hand in productDetails.tpl, which is 0 or 1 (the latter meaning there are items on stock). So the code could be:

Code: Select all

<?php if ($this->product->stock_on_hand):?>
    // show button, etc.
<?php else:?>
    // show something else
<?php endif;?>
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply