|
NAMEInterchange6::Schema::ResultSet::ProductSYNOPSISProvides extra accessor methods for Interchange6::Schema::Result::ProductMETHODSSee also DBIx::Class::Helper::ResultSet::Shortcut which is loaded by this result set.activeReturns all rows where "active" in Interchange6::Schema::Result::Product is true.canonical_onlyReturns all rows where "canonical_sku" in Interchange6::Schema::Result::Product is null, i.e. only canonical products.listingThis 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 with_average_ratingAdds "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. with_media $type?Prefetch related active Interchange6::Schema::Result::Media where "type" in Interchange6::Schema::Result::MediaType is $type.$type defaults to "image" if not provided. with_quantity_in_stockAdds "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. with_lowest_selling_priceArguments should be given as a hash reference with the following keys/values:
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. with_highest_priceFor 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.with_variant_countAdds column "variant_count" which is a count of variants of each product.
Visit the GSP FreeBSD Man Page Interface. |