Skip Navigation

[Resolved] Mark with a different marker depending on the field content.

This support ticket is created 2 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#2256981
220103-6.png
220103-5.png
220103-4.png
220103-2.png
220103-1.png
220103-0.png

There are pharmacies with products and pharmacies ordered by pharmacists when consumers request an order.
1. There are two types of CPT: pharmacy and product.
2. I connected the two CTPs to the relationship. At this time, I made a check box with "have" and "order" as a field of relationship
3. I made a content template for the product.
But I'm going to mark it in a different maker depending on the pharmacy's product preparation, but I don't know how

I tried to divide the view into the relationship field under the condition of view-query, but it didn't work.

What is the link to your site?
yaksa.site/contents

#2258045

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

To suggest the best way to achieve this, I'll need to see exactly how these elements are set up in the admin area.

Can you please share temporary admin login details, along with the example page where this view can be seen?

Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.

regards,
Waqar

#2258993

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the admin access.

I'm not able to access most of the admin area pages, because there are many errors in the console related to "net::ERR_CONNECTION_RESET".

I noticed that your website has a "Duplicator Pro" plugin installed, which supports multi-site networks too.

Can you please share a clone/snapshot of this individual website ( /contents ), so that I can deploy and investigate this on my test sever?
( ref: https://toolset.com/faq/provide-supporters-copy-site/ )

I've set your next reply as private again.

#2260833

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing the duplicator packages.

I'm currently performing some tests and will share my findings, as soon as this testing completes.

Thank you for your patience.

#2261433

There are changes in the process of creating a site.

I will save it on Google drive with duplication pro.

#2262691

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

I've downloaded the latest duplicator package and will keep you updated with my findings.

#2263717

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for waiting.

I was able to show different map markers in the view named "product-position-have" (that is placed inside the content template "neture-sevice-tem"), based on the value from the intermediary post field "Choice have / Order at the request of consumers", using the following steps:

1. In the "Map" block of the content template, I removed the marker ID and set the dynamic source to "Address", so that map doesn't automatically show the map markers from the view.
( screenshot: hidden link )

2. Next, I registered a custom shortcode that gets value from the related intermediary post field "Choice have / Order at the request of consumers" and returns "Home.png" marker file if the value is '1' (have) and "Shop-2.png" marker file if the value is '2' (order).

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.


add_shortcode('get_related_neture_store_marker', 'get_related_neture_store_marker_func');
function get_related_neture_store_marker_func() {
	$output = do_shortcode('[types field="have-or-order" item="@neture-store.intermediary" output="raw"][/types]');
	$site_url = do_shortcode('[wpv-bloginfo show="url"]');
	if($output == 1) {
		return $site_url.'/wp-content/plugins/toolset-maps/resources/images/markers/Home.png';
	}elseif ($output == 2) {
		return $site_url.'/wp-content/plugins/toolset-maps/resources/images/markers/Shop-2.png';
	}
}

3. Next, I added "get_related_neture_store_marker" in the "Third-party shortcode arguments" section, at WP Admin -> Toolset -> Settings -> Front-end Content.

4. In the last step, I included a "Fields and Text" block in the view's "View Loop" block and added a shortcode for the map marker, like this:
( ref: https://toolset.com/documentation/programmer-reference/maps/maps-shortcodes/#wpv-map-marker )


[wpv-map-marker map_id='map-2' marker_id='marker-[wpv-post-id]' marker_icon='[get_related_neture_store_marker]' marker_field='wpcf-pharmacy-address1'][/wpv-map-marker]

I hope this helps and please let me know if any step/point is not clear.

#2265153

The test was not completed.
The phenomenon that has been repeated several times has occurred again and the work has not been carried out.

When working with toolset, sometimes the gutenberg editor did not open.
At this time, I deactivate all plug-ins and reactivate them one by one.
Sometimes I solved it by processing it with phpmyadmin: wp-option -> active_plugin -> a,0,{}.

This time, even if I proceed with the above process, it won't be resolved

And this time, not only the gutenbegg editor but also toolset and custom post types are not available.
Even if you delete the custom code you sent, the problem will not be solved.

hidden link

yaks.site/contents

hidden link

#2266229

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for writing back.

This is the same "net::ERR_CONNECTION_RESET" issue that I mentioned earlier and I thought only I was experiencing this. That is why, I requested to download your website's clone and work on that.

Since, I'm not facing the same issue when working on your website's clone on a different server, it suggests it is related to how your server or domain is configured.

I'll recommend getting in touch with your web host and the domain provider and checking if they're using any proxy or unusual setup, which can cause this.

#2267055

I understood.
Thank you for your supports.

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.