Requests for Manufacturer and Supplier management

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
12 years 10 months ago #19406

There will be a manufacturer feature in next release.

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

  • Posts: 272
  • Thank you received: 3
12 years 10 months ago #19410

I know. I was just reflecting on why we choose a different way of implementing the manufacturers management. Anyway look forward to it.

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

  • Posts: 272
  • Thank you received: 3
12 years 9 months ago #19959

Just had a quick look at the manufacturer. Okay, using the category you save a lot of code repetition. However my comments are:

1) Missing the possibility to filter products by manufacturer in the back end. I know that many clients have a to update information pertaining to particular manufacturer and it is very convenient for them in for they can filter all the products by the manufacturer.
2) If you add a menu link starting the Joomla side there is no entry for manufacturer. I know you can choose either product or category then when setting the hikashop menu configuration you can set "Type of content" to manufacturer. It would be much more intuitive if there was a specific manufacturer link the Joomla menu tree
3) In the front end, while viewing a category product listing, it would be nice to be able to filter the results by manufacturer. I have hacked the front-end to do this. If you are interested in seeing these files let me know
4) Add the manufacturer name the product show page.

As always I look forward to your comments.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
12 years 9 months ago #19981

1. Indeed that's a good idea. We'll look at adding that.

2. I see what you mean. It's however not really easy to put in place because of the way the menu types work in joomla. We'll see if we can come up with a solution. Otherwise it will stay like that.

3. Configurable filters will come later on.

4. We will have to add an option for that.

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

  • Posts: 272
  • Thank you received: 3
12 years 9 months ago #20605

Regarding point 2, I was thinking the display of the products by manufacturer is very similar to product listing which is filtered by category, only in this case it is filtered by manufacturer. Currently we all manufacturers in the parent manufacturer category. We have not added any further structure to the hierarchy.

So could we not create a "product manufacturer" listing and in the product listing function add a way to filter by manufacturer instead of category?

In the case when manufacturers are organised into various different category we could modify the category list function so that it lists the manufacturer category listings instead of the category product listings?

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
12 years 9 months ago #20616

You should already be able to add a manufacturer as "parent category" of your menu/module.

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

  • Posts: 7
  • Thank you received: 0
12 years 9 months ago #21415

Hello everyone

first of all.. I am amazed by HikaShop and thank you developers for such a great product.

I have "solved" a problem for displaying all items by manufacturer in my own way. I just created new category under root and manually add category to every product (but it is very time consuming)

I am not a programmer so I don't know if this can be done, or maybe it is already possible but I just don't know how to do it?:)

I run a small cosmetic shop and my structure looks like this:
(example):

root/lipsticks/manufacturer1, manufacturer2, .../products
root/nail_polish/manufacturer1, manufacturer2, .../products
.
.
.

I was thinking - for now I can only assign manufacturer1 category to it's parent category (lipsticks, nail polish...)

But if I could assign a manufacturer1 to some other category this could be solved very easily.

manufacturer1 from lipsticks, and manufacturer1 from nail_polish could be linked to root/manufacturers/manufacturer1

Then a menu link can be created - Category listing that would display all products by certain manufacturer (root/manufacturers/manufacturer1)

Basically - if a product can be assigned to multiple categories, maybe a category could be too? (not just a parent category)

I tried to write all as simple as possible:) I hope you can understand what I'm trying to say:)

Last edit: 12 years 9 months ago by mpslo.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
12 years 9 months ago #21422

It's not possible to attribute several parent categories to a category. The whole categories structure would have to be changed for that as it is optimized for the way it's done. You will indeed have to create several categories with the same name for each main category and then add these categories for your products (that's not a problem since you can have several categories for a product).

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

  • Posts: 7
  • Thank you received: 0
12 years 9 months ago #21423

Oh OK:)

I did assign my products to multiple categories as a workaround, and it workes perfectly.

It was just a thought.. it would save some time if I could assign categories to other than just parent:)

Keep up with great work!

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

  • Posts: 272
  • Thank you received: 3
8 years 5 months ago #220122

Hi, as discussed in the previous posts in the this thread, we customised Hikashop for a client, so that they could manage suppliers and supplier prices in the back end. As you can see in the first 3 attachments, clicking on add in the Suppliers box would open a window, in which the user could select the supplier for that product, clicking Add would close the window and add a new line in the Supplier box with the name and currency filled out.

We are now working to update this functionality for version 2.6.0, which has implements an improvement in the interface and code, but we are having some difficulties in getting it to work. So far we have recreated the supplier box. The HIKASHOP_ADD_SUPPLIER button opens a popup window to select the supplier. We have created a javascript addSupplier function which inserts a new line with the supplier name and currency. However when we click on "Ok" in the popup window we are having difficulty in understanding the new logic for firing the addSupplier javascript function to add a new line to the supplier box with the supplier details while closing the popup window.

Any help would be most appreciated.

Thanks, James

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
8 years 5 months ago #220169

Hi,

I don't see the difference with the old versions for what you want to do.
It should still work the same as before.
You could actually directly change the code:

<button class="btn" type="button" onclick="if(document.adminForm.boxchecked.value==0){alert('<?php echo JText::_( 'PLEASE_SELECT_SOMETHING',true ); ?>');}else{submitbutton('addcategory');}"><img src="<?php echo HIKASHOP_IMAGES; ?>add.png"/><?php echo JText::_('OK'); ?></button>
in the file selectcategory now since the category popup selection isn't used anywhere anymore and directly put your custom JS function call in there.

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

  • Posts: 272
  • Thank you received: 3
8 years 5 months ago #220384

Hi Nicolas,

thanks for the pointer. We will look at this and let you know how we get on.

Thanks, James

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

  • Posts: 272
  • Thank you received: 3
8 years 5 months ago #220653

Hi Nicolas,

we have updated the addsupplier php function which is attached. I have a couple of questions:

1) how do we fire our addSupplier javascript function
2) is it better to get the supplier data first as in the attached php function and pass it to the javascript function or get the supplier data via ajax call in the addSupplier javascript function?

Thanks, James

Attachments:

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
8 years 5 months ago #220742

Hi,

I guess that you want to add your code in the "addcategory" file of the view "product" which is called once you select a category in a "selectcategory" popup (which is what you're using to select the category I suppose).

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

  • Posts: 272
  • Thank you received: 3
8 years 5 months ago #220803

Hi Nicolas,

we have the javascript function window.productMgr.addSupplier in the form_supplier.php file. When we run the function addsupplier which is in the file product/ view.hmtl.php we have

$js = 'window.hikashop.ready(function(){window.parent.productMgr.addSupplier({suppliers:'.$output.'});});';

But is it not firing this function. Are we getting this completely wrong?

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

  • Posts: 272
  • Thank you received: 3
8 years 5 months ago #221199

Okay we worked the logic out. We can open the popup window to choose the supplier and return to the parent window. The javascript addSupplier function is now being called. In our addSupplier function we are calling the hikashop dupRow javascript function to create a new row in the table.

Can we use the extraData variable in the dupRow function to insert the Supplier information we want to show in the new row? We could not find any example in the existing code where the extraData was used.

Thanks, James

Last edit: 8 years 5 months ago by jameswadsworth. Reason: added more info.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
8 years 5 months ago #221221

Hi,

Here is an example of how to use the dupRow:

window.hikashop.dupRow("hikashop_field_values_table_template", {
				"TITLE":"field_values[title][]",
				"VALUE":"field_values[value][]",
				"DISABLED":"field_values[disabled][]"
			})
The extraData parameter can actually be used to the same as the second parameter and the format is the same as well.

The following user(s) said Thank You: jameswadsworth

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

  • Posts: 272
  • Thank you received: 3
8 years 4 months ago #222395

Hi Nicolas,

your hint works perfectly, well almost perfectly ;) . We tried using it to pass the supplier currency id. In the followoing code

cho $this->currencyType->display($form_key.'[{id}][supplier_currency_id]', '{SUPPLIER_CURRENCY}' , 'class="no-chzn"');

The SUPPLIER_CURRENCY is replace by the supplier currency id. However php treats this value as a string not a numeric string or integer and so the right value is not shown as selected. Type casting or intval converts the string to an integer but as zero.

Do you have any suggestions? Thanks

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
8 years 4 months ago #222524

Hi,

I'm sorry but I'm not following you.
The currencyType class just displays a dropdown of currencies.
If you're doing a custom work anyway, why not simply echo the HTML of the dropdown you want the way you want ?
The type.currency forces the currency_id to be an int so that when used in the MySQL query it cannot lead to a SQL injection. So we can't remove it and you can't bypass it.
But then, you can echo the dropdown yourself, it should be simple to do.

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

  • Posts: 272
  • Thank you received: 3
8 years 4 months ago #222558

Probably I have not explained the problem very well. We are using hikashop dupRow javascript to add and extra row in the product supplier table. The row we add is

<tr class="row<?php echo $k; ?>" id="hikashop_<?php echo $form_key; ?>_tpl" style="display:none;">
			<td class="hikashop_supplier">
				<input type="hidden" name="<?php echo $form_key; ?>[{id}][supplier_id]" value="{SUPPLIER_ID}"/>
				<a href="<?php echo hikashop_completeLink('supplier&task=edit&cid='.@$supplier->supplier_id); ?>">{SUPPLIER_NAME}</a>
			</td>
<?php if($acls['code']){ ?>
            <td class="hikashop_supplier">
                <input size="10" type="text" name="<?php echo $form_key; ?>[{id}][supplier_product_code]" value="" />
            </td>
<?php }
	if($acls['currency']){ ?>
            <td class="hikashop_currency"><?php
				echo $this->currencyType->display($form_key.'[{id}][supplier_currency_id]', '{SUPPLIER_CURRENCY_ID}' , 'class="no-chzn"'); ?>
            </td>
<?php }
	if($acls['price']){ ?>
            <td class="hikashop_price">
              <input size="10" type="text" name="<?php echo $form_key; ?>{id}][supplier_product_price]" value="" />
            </td>
<?php }
	if($acls['active']){ ?>
            <td align="center">
               <input type="checkbox" name="<?php echo $form_key; ?>[{id}][supplier_active]" value="1" <?php echo !empty($supplier->supplier_active) ? 'checked="checked"' : ''; ?> />
            </td>
<?php } ?>
            <td>
				<a href="#" onclick="window.hikashop.deleteRow(this); return false;"><img src="<?php echo HIKASHOP_IMAGES; ?>delete.png" alt="<?php echo JText::_('HIKASHOP_DELETE'); ?>"></a>
            </td>
        </tr>

We use the extraData to replace the variables {SUPPLIER_NAME}, {SUPPLIER_ID}, {SUPPLIER_CURRENCY_ID} with the data we get in our addsupplier function (in view.html.php of the product). It all works perfectly. For example we choose a supplier with USD as their currency, {SUPPLIER_CURRENCY_ID} is replace by the value '2'. However if we run a quick test in the function display of the currencyType class, dump_var($value) returns string(22) "2". The value is two, but the string length is 22! Which corresponds to the length of {SUPPLIER_CURRENCY_ID}. So when the Joomla code makes a comparison of the key with the value although it looks like it comparing 2 == 2 really it is comparing string(1) "2" == string(22) "2" and hence it is not showing up as selected.

Any ideas how to make php "forget" the original string and evaluate just the value "2"?

Last edit: 8 years 4 months ago by jameswadsworth.

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

Time to create page: 0.107 seconds
Powered by Kunena Forum