Skip to content

Instantly share code, notes, and snippets.

@bentasm1
Last active October 13, 2016 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bentasm1/664894f93016becdc5bf to your computer and use it in GitHub Desktop.
Save bentasm1/664894f93016becdc5bf to your computer and use it in GitHub Desktop.
For archive-product.php and specific vendor info
<?php
/* This goes somewhere in your archive-product.php template. This will check if the URL they are on is a vendor store,
* and if it is, do something, if it isn't, do something else. Writhing the somethings is up to you. :)
*/
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
if ( $vendor_id ) {
// Do something
} elseif {
// Do something else
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment