As many have noted, a reasonable starting point for analysis is to consider the cost of transporting the product from A to B.
But that's only one of many factors. There are many, many others beyond what you mention.
What alternative products are available in B that people might use as a substitute? Perhaps people in B see potatoes as an alternative to rice, and they are just as happy to eat potatoes as to eat rice. In that case, if the price of rice goes about the price of potatoes, they'll just eat potatoes instead. No matter what the price of rice in A or the shipping costs to get it to B, they won't pay more for rice than they pay for potatoes. If they like potatoes but they like rice more, or if they like to have variety, they may be willing to pay somewhat more for rice, but the price of potatoes will put downward pressure on the price of rice.
How much do people in B want the product, compared to people in A? If the people in A love rice but the people in B hate rice and will only eat it if the alternative is starving to death, the price of rice in B might well be LESS than the price in A despite the shipping costs. (Merchants may only carry rice to B when, say, their caravans would otherwise be under capacity, and they may as well carry a product on which they make a tiny profit rather than have wasted capacity and make nothing.)
Also, bear in mind that there's no such thing as "there is no shortage". Well, there are a few goods that are so abundant that people can get all they want for free. Like air. That may be the only one. Besides that, the law of supply and demand kicks in. If the supply goes up, the price goes down until demand matches supply, and vice versa. There can be temporary surpluses or shortages until the market can adjust, but eventually an equilibrium is reached. There is almost no limit to how much of a product people will consume if the price is low enough.
In this case, suppose people in B are willing to pay a higher price for rice than the price in A plus the shipping costs. Then merchants will have an incentive to ship more rice from A to B to make a higher profit. Either people in A make due with less rice, or the price in A and/or B has to go up until there is an equilibrium again.
Also note that you can't calculate an expected price by "adding in the profit for the merchant". How much profit do you assume? There is no universal law that says merchants always get 17.3% of the selling price or any such formula. Merchants set a price that maximizes their profit, that is, where the number of units they sell at a given price times the profit per unit is the largest for all possible prices. If the maximum is negative, they'll quit selling this product. (Once they are convinced this is a long-term situation and not a temporary fluke.) If they can make more money selling other products, they'll switch to other products. If they can make more money by selling their camels to the butcher shop, that's what they'll do. (Well, lots of caveats on that. Sometimes people will continue in a profession because they enjoy doing it, even though they could make more money doing something else. Or they're tradition-bound, this is what my father did and this is what my grandfather did, etc, and so they stick to it. Etc.)