Download the PHP package pixelpoems/silvershop-wishlist without Composer

On this page you can find all versions of the php package pixelpoems/silvershop-wishlist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silvershop-wishlist

Silvershop Wishlist

A Silverstripe module that adds a single wishlist per member to a Silvershop storefront. Logged-in customers can add products (and product variations) to their wishlist, view it on a dedicated page, and remove items again — with an AJAX-driven "add/remove" button that updates in place without a full page reload.

Requirements

Installation

Then run a dev/build to create the database tables and the WishListPage, which is created automatically on first build (see Auto-created page below).

Frontend assets

The module ships pre-built CSS/JS in client/dist/, which is exposed as a public resource via composer's expose config, so no build step is required to use the module as-is.

If you want to modify the frontend source (client/src/):

This runs Webpack and regenerates client/dist/javascript/wishlist.min.js and client/dist/css/wishlist.min.css.

What it does

Every logged-in member has one wishlist, created automatically the first time they add something to it. Products and variations get an add/remove link (via an extension applied to Silvershop's Product and Variation classes), which posts to a dedicated WishListPage that lists, adds and removes items. A small JS enhancement intercepts clicks on add/remove buttons and updates the page (e.g. a nav badge showing the item count) in place, without a full reload. To enable for non-logged-in users, enable it threw your yml config:

Auto-created page

WishListPage::requireDefaultRecords() creates a single WishListPage (hidden from menus and search, restricted to logged-in users) on dev/build if one doesn't already exist. Disable this by setting auto_create_page: false via YAML config:

CSS and JS Coming along

This module comes with basic CSS and JS to make the wishlist button and nav badge look nice, but you will likely want to customize it for your theme. The module's CSS/JS is loaded automatically via Silverstripe's Requirements API, but you can disable that and load your own files instead:

The Wishlist logic is also working without js - so then the add/remove button will reload the page to update the nav badge and button state. The JS is just a progressive enhancement to avoid full page reloads.

Usage in templates

Render the wishlist nav badge (e.g. in your header):

Render an add/remove button on a product/variation (see CanAddToWishListExtension):

ProductID should always be the product's ID (not the variation's) - pass $Up.ID when looping over $Variations, and add Variation=true in that case so the markup gets a variation--actions-{$ID} id/class alongside the shared product--actions-{$ProductID} one. Pass Size=sm to render an icon-only button (no text label), which is the default for anything but sm.

The bundled wishlist.js progressively enhances any .action-wishlist button: it intercepts the click, fetches the add/remove link via AJAX, replaces the button's product--actions-{$ProductID} container (and the nav badge) with the freshly rendered HTML from the response, and toggles the button's add/remove state without a full page reload.

Customizing the icon

The heart icon markup lives in its own include, Pixelpoems\Wishlist\Includes\WishList_Icon, which Product_WishListAction.ss includes and switches on $IsInWishList. To use your own icon (e.g. a sprite <use> reference instead of the bundled inline SVGs), override just this one file rather than the whole button - create a template at the same relative path in your project/theme:

Because the ajax response re-renders the button (and therefore this include) server-side on every add/remove, an overridden icon stays correct after a click too - there's no icon markup duplicated in wishlist.js to keep in sync.

Translations

Bundled lang/ files: en, de, es, fr, pl, ro.

Known limitations

This module is a work in progress:

Reporting Issues

Please create an issue for any bugs you've found, or features you're missing.

Credits

Icons from Font Awesome - https://fontawesome.com


All versions of silvershop-wishlist with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3 || ^8.4 || ^8.5
silverstripe/cms Version ^6.0
silvershop/core Version ^6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pixelpoems/silvershop-wishlist contains the following files

Loading the files please wait ...