Shopify Objects Kya Hai? Sabhi Important Objects Ki Detail Explanation in Hindi

Shopify Objects क्या है सभी Important Objects की Detail Explanation

Introduction

हेलो दोस्तों आज हम इस post में shopify के most important Objects के बारे में जानेगे ये कोनसे Objects है और ये सभी Objects में कोनसी properties होती है!. ये सभी Objects के बारेमे सभी shopify developers को जानकारी जरूर छे होनी ही चाहिए जो आप इस post में जानेगे!.

What are Shopify objects in Hindi?

Shopify में objects predefined global variables होते हैं जो store के different data को access करने के लिए use किये जाते हैं!. यह objects store, customers, orders, products, blogs और pages से related information को fetch करने में मदद करते हैं!.
अगर आप Shopify theme development या Liquid programming में काम कर रहे हैं, तो आपको इन objects का use करना आना चाहिए!.

Shopify Objects Lists

  1. Product Object
  2. Collection Object
  3. Cart Object
  4. Customer Object
  5. Order Object
  6. Blog Object
  7. Article Object
  8. Product Variant Object
  9. Page Object
  10. Shop Object

Product Object

Shopify में product एक most important Object है!. यह store के product के properties का एक collections होता है!. Product object में product की properties जैसे की product का title, description, images, price, tags, template name, variant option होती है!. और product Object को हम केवल product template पर ही access कर सकते है और product की properties को display करा सकता है!.

Product template हम product.liquid और product.new-product.liquid जैसे custom name से create कर सकते है और उसको केवल उन product template पर एक्सेस कर सकते है!.

Product की properties और उसकी detail

product.title: वह product का name यानि title होता है!.
product.description : यह product की detail बताता है!.
Product.price: product price
product.variants: यह Product के different versions को represent करता है!.
product.images: उसमे product की सभी images होती है!.
product.handle: Product का unique URL slug
product.vendor: Product का manufacturer/brand
product.type: Product का category type
product.tags: Product के tags
product.options: Variants के options जैसे size, color

Example:

<h2>{{ product.title }}</h2>
<p>Price: {{ product.price | money }}</p>

Collection Object

Collection Object एक Multiple product का group होता है!. और collection object को collection template पर access कर सकते है!. Collection Object की कई properties है और उसके मुताबिक data को access कर सकते है!. properties जैसे की title, description, handle, image, products etc..
Collection template हम collection.liquid और collection.new-collection.liquid जैसे custom name से create कर सकते है और उसको केवल उन collection template पर access कर सकते है!.

Collection object की properties और उसकी detail

collection.title:  Collection का नाम
collection.description: Collection की details
collection.products: Collection में कितने products है!
collection.handle: Collection का unique URL slug
collection.image: Collection की image

Example:

<h1>{{ collection.title }}</h1>
<p>{{ collection.description }}</p>
{% for product in collection.products %}
  <h2>{{ product.title }}</h2>
{% endfor %}

Cart Object

Shopify में Cart Object line items की detail को store करता है जो user ने selected product को cart में add करि होती है!. और वह एक global object है जिसे हम store में किसी बी template, section, snippets में access कर सकते है!.

cart.item_count: Cart में total items
cart.total_price: Cart का total price
cart.items: Cart के अंदर के products
cart.currency: Cart की currency

Example:

<h2>Your Cart</h2>
<ul>
  {% for item in cart.items %}
    <li>{{ item.product.title }} - Quantity: {{ item.quantity }}</li>
  {% endfor %}
</ul>

Customer Object

customer object Shopify के Liquid templating language में एक predefined global object है जो logged-in customer की details को access करने के लिए use होता है!. customer object के अंदर काफी सारी properties होती हैं जो एक logged-in user के बारे में information देती हैं!.

Customer properties के बारे में आप निचे detail में देख सकते है!.

customer.first_name: Customer का first name
customer.last_name: Customer का last name
customer.email: Customer ka email address
customer.orders_count: कितने orders place किये hain
customer.total_spent: Customer का total spend amount
customer.addresses: Customer के सारे addresses का array
customer.default_address: Customer का default address

Example:

{% if customer %}
  <p>Welcome, {{ customer.first_name }} {{ customer.last_name }}!</p>
{% else %}
  <p>Please <a href="/account/login">log in</a> to see your details.</p>
{% endif %}

Example 2:

{% if customer %}
  <p>Email: {{ customer.email }}</p>
  <p>Total Orders: {{ customer.orders_count }}</p>
  <p>Total Spent: {{ customer.total_spent | money }}</p>
{% else %}
  <p>Please log in to see your order history.</p>
{% endif %}

Order Object

order object Shopify के Liquid templating language का एक predefined global object है जो किसी भी specific order की details को access करने के लिए use होता है!.
आप इसे customer के past orders, order history, या order confirmation pages पर use कर सकते हैं!. order object में बहुत सारी properties होती हैं जो किसी specific order के details को store करती हैं!.

order.id: Order का unique ID
order.name: Order number (e.g., #1001)
order.created_at: Order की date और time
order.total_price: Order का total price
order.currency: Order की currency (e.g., INR, USD)
order.financial_status: Payment का status (paid, pending, refunded)
order.fulfillment_status: Order का fulfillment status (fulfilled, unfulfilled, partial)
order.line_items: Order में जो products हैं उनकी list
order.customer: Order place करने वाले customer की details
order.shipping_address: Customer का shipping address
order.billing_address: Customer का billing address
order.discount_applications: Order पर applied discounts
order.transactions: Order की payment history

Example:

<h2>Order Details</h2>
<p>Order Number: {{ order.name }}</p>
<p>Order Date: {{ order.created_at | date: "%B %d, %Y" }}</p>
<p>Total Amount: {{ order.total_price | money }}</p>
<p>Status: {{ order.financial_status }}</p>

Blog Object

blog object Shopify के Liquid templating language में एक predefined global object है जो किसी blog section की details को fetch करने के लिए use होता है!. Shopify में हर store में एक default blog होता है जिसका नाम “News” होता है!, लेकिन आप नए blogs भी create कर सकते हैं!. blog object के अंदर बहुत सारी properties होती हैं जो किसी blog की details को access करने के लिए use होती हैं!.

blog.id: Blog का unique ID
blog.title: Blog का title
blog.articles: Blog के articles का list (array)
blog.handle: Blog का unique handle (URL slug)
blog.comments_enabled?: Blog के comments enable हैं या नहीं
blog.articles_count: Blog में total articles की संख्या

Example:

<h2>{{ blog.title }}</h2>
<ul>
  {% for article in blog.articles %}
    <li>
      <a href="{{ article.url }}">{{ article.title }}</a> 
      - Published on {{ article.published_at | date: "%B %d, %Y" }}
    </li>
  {% endfor %}
</ul>

Articles Object

article object Shopify के Liquid templating language का एक predefined global object है जो किसी specific blog article (blog post) की details को access करने के लिए use होता है!.
अगर आप Shopify store में blogging का use कर रहे हैं और articles को customize करना चाहते हैं, तो article object का use कर सकते हैं!. article object के अंदर बहुत सारी properties होती हैं जो किसी specific blog article के details को access करने के लिए use होती हैं!.

article.id: Article का unique ID
article.title: Article का title
article.author: Article लिखने वाले का नाम
article.content: Article का पूरा content
article.excerpt: Article का short summary
article.excerpt_or_content: अगर excerpt available है तो वही, वर्ण article का कुछ content
article.tags: Article के tags (array)
article.url: Article का URL
article.handle: Article का unique slug
article.published_at: Article की published date
article.image: Article की featured image
article.metafields: Custom metafields जो article के साथ store होते हैं!

Example:

<h1>{{ article.title }}</h1>
<p>By {{ article.author }} on {{ article.published_at | date: "%B %d, %Y" }}</p>
<div class="blog-content">
  {{ article.content }}
</div>
<p>{{ article.excerpt_or_content | truncatewords: 30 }}</p>
{% if article.image %}
  <img src="{{ article.image | img_url: 'medium' }}" alt="{{ article.title }}">
{% endif %}

Product Variant Object

variant object Shopify के Liquid templating language का एक predefined global object है जो किसी specific product variant की details को access करने के लिए use होता है!.
अगर आप Shopify store में product variants को customize करना चाहते हैं, तो variant object का use कर सकते हैं!.
Product Variant Object की Important Properties

variant.id: Variant का unique ID
variant.title: Variant का title (ex: “Red / Medium”)
variant.sku: Variant का SKU (Stock Keeping Unit)
variant.price: Variant ka current price (cents me stored hota hai)
variant.compare_at_price: Variant का original price ( अगर discount में हो)
variant.available: Variant available है या नहीं (true/false)
variant.inventory_quantity: Variant का stock quantity
variant.option1: पहला option (ex: Color: “Red”)
variant.option2: दूसरा option (ex: Size: “M”)
variant.option3: तीसरा option (ex: Material: “Cotton”)
variant.image: Variant की specific image
variant.barcode: Variant का barcode

Example:

<h2>Available Variants</h2>
<ul>
  {% for variant in product.variants %}
    <li>
      {{ variant.title }} - {{ variant.price | money }} 
      {% if variant.available %} (In Stock) {% else %} (Out of Stock) {% endif %}
      {% if variant.image %}
        <img src="{{ variant.image | img_url: 'medium' }}" alt="{{ variant.title }}">
      {% endif %}
    </li>
  {% endfor %}
</ul>

Page Object

Shopify में page object एक predefined global object है जो किसी specific static page की details को access करने के लिए use होता है!. Shopify store में static pages जैसे About Us, Contact Us, Privacy Policy, FAQ वगैरह के लिए use होती हैं!. page object की मदद से हम इन pages का title,content, handle और metafields को access कर सकते हैं!.

Page Object की Important Properties

page.id: Page का unique ID
page.title: Page का title
page.content: Page का full content
page.handle: Page का unique slug (URL identifier)
page.url: Page का full URL
page.published_at: Page की published date
page.metafields: Page के custom metafields

Example:

<h1>{{ page.title }}</h1>
<div>{{ page.content }}</div>

Shop Object

shop object Shopify के Liquid templating language का एक global object है जो store के basic details और settings को access करने के लिए use होता है!.
इसका use करके हम store का naam, currency, domain, policies, और contact information को fetch कर सकते हैं!.
Shop Object की Important Properties

shop.id: Store का unique ID
shop.name: Store का नाम
shop.domain: Store का primary domain
shop.email: Store का support email
shop.phone: Store का support phone number
shop.currency: Store ki default currency
shop.money_format: Store का currency format
shop.url: Store का full URL
shop.locale: Store का language locale
shop.enabled_currencies: Store में enabled currencies का list
shop.primary_locale: Store का primary language
shop.policies: Store की policies (refund, privacy, terms)
shop.address: Store का registered address
shop.timezone: Store का timezone

Example:

<h1>{{ shop.name }}</h1>
<p>Website: <a href="https://{{ shop.domain }}">{{ shop.domain }}</a></p>
<p>Default Currency: {{ shop.currency }}</p>
<p>Money Format: {{ shop.money_format }}</p>

Shopify objects काफी useful होते हैं और इनका सही तरीके से use करके आप अपनी Shopify theme को dynamically customize कर सकते हैं!.

Leave a Comment

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