Emergency ask: can hikashop create same as this page?

  • Posts: 201
  • Thank you received: 7
5 years 1 month ago #312455

hi.
i need simple system for buy serial of license of software.
my customer ask me to create exactly same as this page: www.giftcard.ir (sorry for non-english language of that site but it is clear to understand what does it do)
look at the recorded ScreenCast video for what does it do.( www.screencast.com/t/d493y0g8 )
please say me these questions:
1-if it can create with hikaserial?(if can not, say me what thing can not do by hikaserial?) Answered
2-is it possible put checkout section for buy in one page (at the home page and don't need to redirect to other page for checkout workflow. )
3-is it possible have category Div as a filter(categoryname+category image) and when click on that, show the products in that category without refresh of page?(in my case product is serial) i test filter in hikashop but it seems can not show image of category(only show category name)
i find back/classes/filter.php line 1783 and get this picture after dump $html:


but i can't see image in the cat object.what is php function to get image of category? also i hack the core. can you give me simple example to how use onFilterDisplay to change any thing in filter category name.
also i check this demo page:https://demo.hikashop.com/index.php/en/other-features/products-with-serial-number
but my questions is still without response.(if it need to modify View please say what of that?)

Attachments:
Last edit: 5 years 1 month ago by sadaf3d.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 1 month ago #312460

Hi,

2. No, you can't do that. HikaShop is a shopping cart extension. So you need first to add the product to the cart and then you can go to the checkout and click on the finish button.
There is no mechanism to have a one page where you can have everything from the categories listing, the products listing the product information and the checkout.

3. To have the products listing refresh below a category listing without changing the page, I also think that the solution is to use a category filter.
And indeed, there is no option to display the image of the category in the filter.
Modifying classes/filter.php will be the easiest.
To get the image of the category, you'll have to use such code:

$db = JFactory::getDBO();
$db->setQuery('SELECT * FROM #__hikashop_file WHERE file_ref_id = '.(int) $category_id .' AND file_type=\'category\'');
$image = $db->loadObject();
$config = hikashop_config();
$image_options = array('default' => true,'forcesize'=>$config->get('image_force_size',true),'scale'=>$config->get('image_scale_mode','inside'));
$imageHelper = hikashop_get('helper.image');
$img = $imageHelper->getThumbnail(@$image->file_path, array('width' => 100, 'height' => 100), $image_options);
echo '<img src="'.$img->url.'"/>';
It's going to be difficult to do that elsewhere than directly in classes/filter.php
What you could do is actually override the whole classes/filter.php with a system plugin:
www.hikashop.com/forum/checkout/878018-c...asses-field-php.html
www.hikashop.com/forum/development/88665...le-in-hikkashop.html

The following user(s) said Thank You: sadaf3d

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

  • Posts: 201
  • Thank you received: 7
5 years 4 weeks ago #312482

nicolas wrote: Hi,

2. No, you can't do that. HikaShop is a shopping cart extension. So you need first to add the product to the cart and then you can go to the checkout and click on the finish button.
There is no mechanism to have a one page where you can have everything from the categories listing, the products listing the product information and the checkout.

OK i agree that. i set a cart module on product menu item and enable payment.
2-1)what is payment option in cart module? if i enable that it show to me Payment Methods option to select that? if no, is there possible to implement selectable payment plugin for select what gateway for pay in the cart module?
2-2)for fastest checkout workflow something such as www.giftcard.ir , i want do this: use hikashop cart module under the product and when click "Proceed to Checkout" button,then go to checkout workflow page with one step without any registration form and i put some custom JS in my joomla template to auto click on Finish button to go to pay gateway. is it possible and maybe have any problem?

nicolas wrote: 3. To have the products listing refresh below a category listing without changing the page, I also think that the solution is to use a category filter.
And indeed, there is no option to display the image of the category in the filter.
Modifying classes/filter.php will be the easiest.
To get the image of the category, you'll have to use such code:

$db = JFactory::getDBO();
$db->setQuery('SELECT * FROM #__hikashop_file WHERE file_ref_id = '.(int) $category_id .' AND file_type=\'category\'');
$image = $db->loadObject();
$config = hikashop_config();
$image_options = array('default' => true,'forcesize'=>$config->get('image_force_size',true),'scale'=>$config->get('image_scale_mode','inside'));
$imageHelper = hikashop_get('helper.image');
$img = $imageHelper->getThumbnail(@$image->file_path, array('width' => 100, 'height' => 100), $image_options);
echo '<img src="'.$img->url.'"/>';

nicolas wrote: It's going to be difficult to do that elsewhere than directly in classes/filter.php
What you could do is actually override the whole classes/filter.php with a system plugin:
www.hikashop.com/forum/checkout/878018-c...asses-field-php.html
www.hikashop.com/forum/development/88665...le-in-hikkashop.html

very thank you for your code it is work but i can not use overwrite capability and it is not work correctly for me. i read all given link and it seems i only can first class of filter.php to overwrite. can you say me how to overwrite display() in hikashopRadioClass and function displayInList() and function getCategories() in hikashopFilterTypeClass? is it possible give me simple echo helloworld instead of display() in hikashopRadioClass ?
i read some override that you say in different topics but i need sample code to do simple change. now i hack the core and it work. i attached one filter.php from core. can you change file name and class name to right in attached file to put it in MYTEMPLATE/html/com_hikashop/administrator/classes/ and work.

Attachments:
Last edit: 5 years 4 weeks ago by sadaf3d.

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

  • Posts: 201
  • Thank you received: 7
5 years 4 weeks ago #312483

4-i have an other question. all of i do now, for example override and purchase product and setting in cart module can be replicate with serial in hikaserial? i want only sell serial not product.

Last edit: 5 years 4 weeks ago by sadaf3d.

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

  • Posts: 201
  • Thank you received: 7
5 years 4 weeks ago #312494

i search and try more than 4 hours and it seems only i can use displayFilter in the main class (first php class in filter.override.php). am i right?

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 4 weeks ago #312485

Hi,

2.1 The selection of the payment method is done on the checkout. There is no option to be able to select the payment method in the cart module.
Now, one payment method is preselected automatically in the cart, so if you only have one payment method, you don't need to have the payment selection on the checkout.
Also, if you want to modify the the code, it's possible to add the selection of the payment method in the cart module. You would have to have a view override of the product / cart .php view via the menu Display>Views where you would add (at the end for example) a form with the HTML for the payment methods selection which would submit in AJAX to a system plugin you would have developed to get the selection of the payment method and the id of the cart and update it in the hikashop_cart table in the database.

2.2 It's totally possible to do that.
You can use the "checkout workflow" setting in HikaShop configuration to remove all the pieces you don't need from the checkout page so that you can auto submit the checkout form with a bit of javascript in the checkout / show.php view file that you can edit via the menu Display>Views.

3. What you need to do is to create your own plugin of the group "system" and make sure that it is loaded before HikaShop's system plugins (with the order of the plugins in the plugins manager). And in the main file of the plugin, you want to copy all the code of that filter.php file. That way, the classes from your plugin will be found before HikaShop tries to load the filter.php file and it will directly use them.

4. Yes, I don't see a problem with that. HikaSerial integrates into HikaShop. So in your products, you'll select "packs" that will contain serial numbers (or a generator setup) and once the product is purchased in HikaShop, HikaSerial will attach one of the serials of the pack of the product to the order (or generate one if it's a generator setup).

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

Time to create page: 0.078 seconds
Powered by Kunena Forum