GithubHelp home page GithubHelp logo

wishlist's Introduction

Module Wish List Thelia 2

This module allows you to create multiple wish list containing your favorite products.

How to install

composer require thelia/wishlist-module dev-main

Next, go to your Thelia admin panel for module activation.

How to use

This module is very easy to use. It provides you new loops "wish_list" and "wish_list_product" type, which will list all the products added to your wish list.

This module provides API routes to create and manipulates wish lists, you can check them on the OpenApi documentation page, on /open_api/doc in the WishList section.

Two Smarty functions are availables :

  • to verify if a product/PSE is already in a wish list (a specific one, or one of the user's wislists) : {in_wishlist pse_id=...|product_id=... [wish_list_id=...]}
{* $ID = product ID *}

{if {in_wishlist product_id="$ID" wish_list_id="$WHISH_LIST_ID"}}
    <a href="{url path="/wishlist/remove/$ID"}">{intl l="Remove from wish list"}</a>
{else}
    <a href="{url path="/wishlist/add/$ID"}">{intl l="Add to wish list"}</a>
{/if}

Here is an example of using the "wishlist" loop :

{loop name="wishlist" type="wish_list"}
    {loop name="wishlistproduct" type="wish_list_product" wish_list_id=$ID}
        {loop name="products-in-wishlist" type="product" id="{$PRODUCT_ID}"}
            <h1>{$TITLE}</h1>
            <p>{$DESCRIPTION|truncate:100 nofilter}</p>
            <a href="{url path="/wishlist/remove/$ID"}">{intl l="Remove from wish list"}</a>
        {/loop}
    {/loop}
{/loop}

The customer_id argument in wishlist loop is allowed only if backend_context is 1, otherwise the current user ID is considered.

wishlist's People

Contributors

alexandrebothamy avatar bibich avatar etienneperriere avatar gillesbourgeat avatar leanormandon avatar lopes-vincent avatar lovenunu avatar lucanis avatar lucascrenais avatar mdevaud avatar mespeche avatar roadster31 avatar zawaze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wishlist's Issues

useless WishListManager

The class WishListManager is useless.

If you want to create specific method for your model, put this methods in Query class. They are not regenerated by Propel.

{if {in_wishlist product_id="$ID"}}" unknown tag "in_wishlist"

in last dev-master thelia
when i try this code

{if {in_wishlist product_id="$ID"}}

  • <a href="{url path="/wishlist/remove/$ID"}" class="link-wishlist">{intl l="Remove from wish list"}

  • {else}
  • <a href="{url path="/wishlist/add/$ID"}" class="link-wishlist">{intl l="Add to Wishlist"}

  • {/if}

    thelia said : {if {in_wishlist product_id="$ID"}}" unknown tag "in_wishlist"

    EventDispatcher

    It's not needed in a listener to inject the EventDispatcher. The EventDispatcher is already present in your Event object

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.