Auction Nudge – Your eBay on Your Site Shortcode

Below, you’ll find a detailed guide on how to add the Auction Nudge – Your eBay on Your Site Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Auction Nudge – Your eBay on Your Site Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Auction Nudge – Your eBay on Your Site Plugin and the shortcodes it provides:

Plugin Icon
Auction Nudge – Your eBay on Your Site

"Auction Nudge – Your eBay on Your Site is a powerful plugin that allows you to integrate your eBay listings directly into your WordPress site. Increase your sales with this easy-to-use tool."

★★★★☆ (81) Active Installs: 2000+ Tested with: 6.2.3 PHP Version: 5.2
Included Shortcodes:
  • [an_get_config]

Auction Nudge – Your eBay on Your Site [an_get_config] Shortcode

The Auction Nudge shortcode is a feature that integrates eBay listings, ads, profile, and feedback into your WordPress site. This shortcode retrieves a tool key from the ‘tool’ attribute. The tool key can be ‘listings’, ‘ads’, ‘profile’, or ‘feedback’. Based on the tool key, it fetches default settings, meta box parameters, and shortcode attributes to build a request. The request is then used to generate a specific eBay snippet for your site.

Shortcode: [an_get_config]

Parameters

Here is a list of all possible an_get_config shortcode parameters and attributes:

  • tool – Determines the type of tool to be used. Options include ‘listings’, ‘ads’, ‘profile’, ‘feedback’
  • an_meta_disable – If set to true, disables the Meta Box feature
  • item_target – Generated unique identifier for the item based on shortcode attributes

Examples and Usage

Basic example – Showcases the use of the Auction Nudge plugin shortcode to display eBay listings.

[an_get_config shortcode="listings" /]

Advanced examples

Displaying eBay ads using the Auction Nudge plugin shortcode. The shortcode attributes specify the tool to be used (ads) and other parameters for the ad display such as size and format.

[an_get_config shortcode="ads" size="large" format="horizontal" /]

Showing an eBay profile with the Auction Nudge plugin shortcode. The shortcode attributes specify the tool to be used (profile) and the username of the eBay profile to be displayed.

[an_get_config shortcode="profile" username="ebay_username" /]

Using the Auction Nudge plugin shortcode to display eBay feedback. The shortcode attributes specify the tool to be used (feedback) and the username of the eBay user for whom the feedback will be displayed.

[an_get_config shortcode="feedback" username="ebay_username" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [an_get_config] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode(an_get_config('shortcode'), 'an_shortcode');

Shortcode PHP function:

function an_shortcode($shortcode_attrs, $shortcode_content, $shortcode_name){
	global $post;

	//Get tool key
	if(! isset($shortcode_attrs['tool']) || ! in_array($shortcode_attrs['tool'], array('listings', 'ads', 'profile', 'feedback'))) {
		return false;
	}
	$tool_key = str_replace(array('listings', 'ads'), array('item', 'ad'), $shortcode_attrs['tool']);
	unset($shortcode_attrs['tool']);
	
	// 1 - Defaults from Config / Settings
 	$request_parameters = an_request_parameters_defaults($tool_key, true);

	// 2 - Meta Box (if not disabled)
	if(! an_get_settings('an_meta_disable', true)) {	
		$meta_parameters = an_get_post_meta($post->ID);
		$meta_parameters = an_request_parameters_from_assoc_array($tool_key, $meta_parameters);
		$request_parameters = array_merge($request_parameters, $meta_parameters);
	}
	
	// 3 - Shortcode attribtues
	$request_parameters = array_merge($request_parameters, an_shortcode_parameters_to_request_parameters($tool_key, $shortcode_attrs, true));		

	//By tool
	switch($tool_key) {
		case 'item':
			//Create target from Shortcode attributes
			$request_parameters['item_target'] = substr(md5(json_encode($shortcode_attrs)), 0, 9);

			break;		
	}

// 	echo '<pre>';
// 	print_r($request_parameters);
// 	echo '</pre>';

	$out = an_build_snippet($tool_key, $request_parameters);
	
	return $out;
}

Code file location:

auction-nudge/auction-nudge/inc/front.php

Conclusion

Now that you’ve learned how to embed the Auction Nudge – Your eBay on Your Site Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *