Different Prices for Similar Item

  • dlaughter
  • Topic Author
11 years 11 months ago #78269

I thought I was going down the right road on this issue but now I'm not so sure. On my site I'm still developing, I have jewelry chains that come in various lengths. My understanding was to create a characteristic for each length with the appropriate price. However, whichever length is added to the cart, the cart is selecting the default price of that item.

On this page at silverconnection.cloudaccess.net/index.p...s/category/15-chains select any chain, then in the characteristic drop down menu, my (incorrect) understanding is that whichever length/price was selected would tell the cart what price to charge. Apparently this is not the case.

How would I instruct the cart to select the correct price for the correct chain length in this instance?

Thanks.

Please Log in or Create an account to join the conversation.

  • dlaughter
  • Topic Author
11 years 11 months ago #78272

Nevermind, found the answer. I had not taken the additional step yet of putting the prices in the individual item characteristics in the manage variants area. All's good.

Please Log in or Create an account to join the conversation.

  • dlaughter
  • Topic Author
11 years 11 months ago #78277

However this brings up another question I noticed when I was creating this page of items. When creating the individual product, a price is required to display with the item. On this page at silverconnection.cloudaccess.net/index.p...s/category/15-chains I have the default price of a particular chain length assigned to the item. However this is a little misleading if the customer wants a different length than the initial price suggests. Example, the first chain on that page is 'Chain BAR' with a displayed price of $30.25. If the customer selects the item then chooses the length of 24", the default assigned price obviously is not the same. Any workarounds for this?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #78307

Hi,

For the default price displayed, you can change the default variant displayed as main product, so the price displayed can be what you want.
Then you can override the translation PRICE_BEGINNING="" to set something like PRICE_BEGINNING="From ".

Please Log in or Create an account to join the conversation.

  • dlaughter
  • Topic Author
11 years 11 months ago #78314

Hmm, could you bring that explanation down a few notches to my level of understanding? :) How could I change the default variant and where would I change the PRICE_BEGINNING at? I'm looking in the Prices table and am not familiar where I could change that.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #78316

Hi,

To change the default variant displayed, in the product edition page, under the part "characteristics" change the default values.

Then, to change the translation, do in HikaShop > Configuration > Languages, and edit you language file. In the override section, add the code previously given.

Please Log in or Create an account to join the conversation.

  • dlaughter
  • Topic Author
11 years 11 months ago #78320

Understand now. If I add PRICE_BEGINNING="From " into the override area, it didn't have any affect. But if I added From to the PRICE_BEGINNING="" translation in the top part, then it works however this causes a wholesale change on every item of the site, which I don't want to do. Just want it displayed on the Chains category. I like the idea though if it can be contained only to the chains.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #78324

Hi,

Try to replace the line:

echo JText::_('PRICE_BEGINNING');
By:
		$prodClass = hikashop_get('class.product');
		$cid = hikashop_getCID();
		if($cid != 0)
			$categories = $prodClass->getCategories(hikashop_getCID());
		else{
			if(isset($this->row->product_parent_id) && $this->row->product_parent_id == '0' && !isset($this->row->cart_id))
				$categories = $prodClass->getCategories($this->row->product_id);
		}
		if(isset($categories) && $categories != null){
			$j = 0;
			foreach($categories as $category){
				if($category == '2' && $j == 0){
					echo JText::_('PRICE_BEGINNING');
					$j++;
				}
			}
		}

In the view "product / listing_price" in HikaShop > Display > Views.

Replace '2' by the id of your category. You can find this id in the categories listing.

Please Log in or Create an account to join the conversation.

  • dlaughter
  • Topic Author
11 years 11 months ago #78332

I'm afraid it didn't display anything. I'd like to continue if we could but will have to wait until tomorrow morning. Thanks so much Xavier for the help so far.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #78334

Hi,

Are you sure that you edited the file in the good view, and replace '2' by the id of the good category ?

Please Log in or Create an account to join the conversation.

  • dlaughter
  • Topic Author
11 years 11 months ago #78502

Not sure what you mean by editing the file in the good view but if I go to Hikashop>Display>Views, then filter for listing_price, I open (view)product / (file) listing_price. If I read your instruction correctly, I delete the line of echo JText::_('PRICE_BEGINNING'); and insert the new code and save. If I do this, even if I change the line of PRICE_BEGINNING="" in the Configuration>Languages file to PRICE_BEGINNING="From " then nothing displays next to the default item price.

If I leave echo JText::_('PRICE_BEGINNING'); in the listing_price file and insert the new code and save, nothing displays next to the default item price as well. I am changing the Category from 2 to 15 (actual category ID) in both instances.

So in both instances of inserting that code or not, the only way the word From appears next to the item price is by changing PRICE_BEGINNING="" to PRICE_BEGINNING="From " in the Configuration>Languages file but again that makes the word From appear next to the item price site wide.

Am I following correctly?

Please Log in or Create an account to join the conversation.

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #78542

Hi,

You can override HikaShop view per template.
For example, your front-end template is "dj-jewellery" and your backend template is "bluestork".
So, if you modify a front end view for another template than "dj-jewellery", your modification would not be seen for your front-end.
And same thing for the backend part, with the "bluestork" template.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • dlaughter
  • Topic Author
11 years 11 months ago #78566

Thanks. Yes I am editing the listing_price file for Front End, dj-jewellery, product. And replacing the category ID with 15. Thanks for all the help.

Please Log in or Create an account to join the conversation.

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #78577

Hi,

Please send me by private message a backend access to your website.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #78591

Hi,

I have fix the code for the listing_price.

    $prodClass = hikashop_get('class.product');
    $cid = hikashop_getCID();
    if(JRequest::getCmd('ctrl') == 'category') {
        $categories = array($cid);
    } else {
    /*
        // Only if you want to display the text on product pages.
        if($cid != 0)
            $categories = $prodClass->getCategories(hikashop_getCID());
        else{
            if(isset($this->row->product_parent_id) && $this->row->product_parent_id == '0' && !isset($this->row->cart_id))
                $categories = $prodClass->getCategories($this->row->product_id);
        }
    */
    }
    if(isset($categories) && $categories != null){
        $j = 0;
        foreach($categories as $category){
            if((int)$category == 15 && $j == 0){
                echo JText::_('PRICE_BEGINNING');
                $j++;
            }
        }
    }

I does not re-change the translation but you can now do it.
If have configure the code in order to just display "PRICE_BEGINNING" on the category listing, not on the product display.
But if you want to display it in the product page, you can just uncomment the block with "/*" and "*/".

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • dlaughter
  • Topic Author
11 years 11 months ago #78592

You guys are the best. Works great. Thanks very much.

Last edit: 11 years 11 months ago by dlaughter.

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum