[Skip to main content](#vessel-content)

#   Post to a RAW view

##

- **[likandev](/forum/user/9788-likandev "View likandev's Profile")**
- [![likandev's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9788.png)](/forum/user/9788-likandev "View likandev's Profile") Topic Author
- [ Offline](/forum/user/9788-likandev)

Less More

- Posts: 69
- Thank you received: 11
-
- [](http://likandevelopment.com)
-

13 years 11 months ago [\#83247](#83247) by [likandev](/forum/user/9788-likandev "View likandev's Profile")  *[Post to a RAW view](/forum/23-market-how-to/77002-post-to-a-raw-view#83247 "Hi guys,  Ww are working on a messaging view for Vendores, we added a new button to the Vendor's Cpanel that reads &quot;Messages&quot;, when clicked, it takes us to a new view called messagemarket, layout = inbox.  This works fine.  I need to be able to post to the same view but in RAW format ( AJAX ), I added a new controller and the RAW view, in the normal MVC model, I would create this and it will automatically direct me to the correct view file ( view.raw.php) and I would receive a response in the correct format ( no template) TEXT or JSON.  Instead of receiving this response, I get a 403 error: Access Denied.  Q: What is the correct way of post with AJAX and receive RAW response in Hikamarket?")* was created by *[likandev](/forum/user/9788-likandev "View likandev's Profile")*

Hi guys,

Ww are working on a messaging view for Vendores, we added a new button to the Vendor's Cpanel that reads "Messages", when clicked, it takes us to a new view called messagemarket, layout = inbox.

This works fine.

I need to be able to post to the same view but in RAW format ( AJAX ), I added a new controller and the RAW view, in the normal MVC model, I would create this and it will automatically direct me to the correct view file ( view.raw.php) and I would receive a response in the correct format ( no template) TEXT or JSON.

Instead of receiving this response, I get a 403 error: Access Denied.

Q: What is the correct way of post with AJAX and receive RAW response in Hikamarket?

---

Eduardo Chongkan - Likan Development
[ ](http://likandevelopment.com)[ likandevelopment.com](http://likandevelopment.com)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vNzcwMDItcG9zdC10by1hLXJhdy12aWV3P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

13 years 11 months ago [\#83256](#83256) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Post to a RAW view](/forum/23-market-how-to/77002-post-to-a-raw-view#83256 "Hi guys,  Ww are working on a messaging view for Vendores, we added a new button to the Vendor's Cpanel that reads &quot;Messages&quot;, when clicked, it takes us to a new view called messagemarket, layout = inbox.  This works fine.  I need to be able to post to the same view but in RAW format ( AJAX ), I added a new controller and the RAW view, in the normal MVC model, I would create this and it will automatically direct me to the correct view file ( view.raw.php) and I would receive a response in the correct format ( no template) TEXT or JSON.  Instead of receiving this response, I get a 403 error: Access Denied.  Q: What is the correct way of post with AJAX and receive RAW response in Hikamarket?")*

Hi,

HikaMarket use the "authorization" function. Each task has to be listed in the controller. Code:

protected $rights = array( 'display' =&gt; array('cpanel', 'show', 'register', 'form'), 'add' =&gt; array(), 'edit' =&gt; array('save'), 'modify' =&gt; array(), 'delete' =&gt; array() );

Some task categories ask for a token (modify / delete). The display category is the default one.
If a task is not listed in this array, the controller would refused it.

I have implemented for the next release of HikaMarket a way to override every classes (or some helpers). I think I will provide such solution for overriding views and controllers.
The idea is to create a new file in the same directory. If you want to override the vendor controller, you would create a file named "vendor.override.php".
This file would be include instead of the classical controller.

The idea is to extend to controller without rewrite it. Code:

&lt;?php include dirname(__FILE__).DS.'vendor.php'; class vendorMarketOverrideController extends vendorMarketController { public function __construct($config = array(), $skip = false) { $this-&gt;rights['display'][] = 'mytask'; parent::__construct($config, $skip); } public function mytask() { JRequest::setVar('layout', 'mytask'); return parent::display(); } }

Like that, you can add and override all you want without loosing any compatibility.
If a controller changes in HikaMarket, some new task are added, you could still update and use the new features ; without loosing yours.
(And I think I will add a function in order to provide a good way to merge rights)

Regards,

---

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

The following user(s) said Thank You: [likandev](/forum/user/9788-likandev "View likandev's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vNzcwMDItcG9zdC10by1hLXJhdy12aWV3P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[likandev](/forum/user/9788-likandev "View likandev's Profile")**
- [![likandev's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9788.png)](/forum/user/9788-likandev "View likandev's Profile") Topic Author
- [ Offline](/forum/user/9788-likandev)

Less More

- Posts: 69
- Thank you received: 11
-
- [](http://likandevelopment.com)
-

13 years 11 months ago [\#83291](#83291) by [likandev](/forum/user/9788-likandev "View likandev's Profile")  Replied by *[likandev](/forum/user/9788-likandev "View likandev's Profile")* on topic *[Post to a RAW view](/forum/23-market-how-to/77002-post-to-a-raw-view#83291 "Hi guys,  Ww are working on a messaging view for Vendores, we added a new button to the Vendor's Cpanel that reads &quot;Messages&quot;, when clicked, it takes us to a new view called messagemarket, layout = inbox.  This works fine.  I need to be able to post to the same view but in RAW format ( AJAX ), I added a new controller and the RAW view, in the normal MVC model, I would create this and it will automatically direct me to the correct view file ( view.raw.php) and I would receive a response in the correct format ( no template) TEXT or JSON.  Instead of receiving this response, I get a 403 error: Access Denied.  Q: What is the correct way of post with AJAX and receive RAW response in Hikamarket?")*

Hi Thanks,

I'll keep it in mind for next time. Yesterday I decided to just use a component I made for posting to it via ajax from anywhere ( modules in example )

That way I can keep my code separated. I did keep the additional views I made.

---

Eduardo Chongkan - Likan Development
[ ](http://likandevelopment.com)[ likandevelopment.com](http://likandevelopment.com)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vNzcwMDItcG9zdC10by1hLXJhdy12aWV3P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.057 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
