GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Interchange6::Schema::ResultSet::Product(3) User Contributed Perl Documentation Interchange6::Schema::ResultSet::Product(3)

Interchange6::Schema::ResultSet::Product

Provides extra accessor methods for Interchange6::Schema::Result::Product

See also DBIx::Class::Helper::ResultSet::Shortcut which is loaded by this result set.

Returns all rows where "active" in Interchange6::Schema::Result::Product is true.

Returns all rows where "canonical_sku" in Interchange6::Schema::Result::Product is null, i.e. only canonical products.

This is just a shortcut for:

  $self->columns( [ 'sku', 'name', 'uri', 'price', 'short_description' ] )
      ->with_average_rating
      ->with_lowest_selling_price
      ->with_highest_price
      ->with_quantity_in_stock
      ->with_variant_count

Though in addition if you pass in arguments these are passed through to the appropriate with_* method so you can do:

  $self->listing({ quantity => 10 })

And the result will be:

  $self->columns( [ 'sku', 'name', 'uri', 'price', 'short_description' ] )
      ->with_average_rating
      ->with_lowest_selling_price({ quantity => 10 })
      ->with_highest_price
      ->with_quantity_in_stock
      ->with_variant_count

Adds "average_rating" column which is available to order_by clauses and whose value can be retrieved via "average_rating" in Interchange6::Schema::Result::Product.

This is the average rating across all public and approved product reviews or undef if there are no reviews. Product reviews are only related to canonical products so for variants the value returned is that of the canonical product.

Prefetch related active Interchange6::Schema::Result::Media where "type" in Interchange6::Schema::Result::MediaType is $type.

$type defaults to "image" if not provided.

Adds "quantity_in_stock" column which is available to order_by clauses and whose value can be retrieved via "quantity_in_stock" in Interchange6::Schema::Result::Product.

The value is retrieved is "quantity" in Interchange6::Schema::Result::Inventory.

For a product variant and for a canonical product with no variants the quantity returned is for the product itself.

For a canonical (parent) product the quantity returned is the total for all its variants.

Arguments should be given as a hash reference with the following keys/values:
quantity => $quantity

"quantity" defaults to 1 if not supplied.

The lowest of "price" in Interchange6::Schema::Result::PriceModifier and "price" in Interchange6::Schema::Result::Product.

For products with variants this is the lowest variant selling_price.

Value is placed in the column "selling_price".

If "current_user" in Schema is defined then any roles assigned to that user will be included in the search of Interchange6::Schema::Result::PriceModifier.

For canonical products with no variants and for variant products "highest_price" is always undef. For canonical products that have variants this is the highest of "price" in Interchange6::Schema::Result::Product of the variants.

Adds column "variant_count" which is a count of variants of each product.
2016-07-31 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.